From 93fd1133ffb3ceee960f4692b59a41bc52021397 Mon Sep 17 00:00:00 2001 From: Marcel Metz Date: Wed, 20 Nov 2013 14:40:20 +0100 Subject: [PATCH] Fixed mingw cross compiler issues. --- CMakeLists.txt | 2 +- include/assimp/types.h | 1 + tools/assimp_view/CMakeLists.txt | 9 ++++++--- tools/assimp_view/HelpDialog.cpp | 2 +- tools/assimp_view/LogWindow.cpp | 2 +- tools/assimp_view/MessageProc.cpp | 2 +- tools/assimp_view/stdafx.h | 4 ++-- 7 files changed, 13 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 98fb8c62d..b0f6b88af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ set(LIBASSIMP-DEV_COMPONENT "libassimp${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_M set(CPACK_COMPONENTS_ALL assimp-bin ${LIBASSIMP_COMPONENT} ${LIBASSIMP-DEV_COMPONENT} assimp-dev) set(ASSIMP_LIBRARY_SUFFIX "" CACHE STRING "Suffix to append to library names") -if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) +if( CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX AND NOT MINGW ) add_definitions(-fPIC) # this is a very important switch and some libraries seem now to have it.... # hide all not-exported symbols add_definitions( -fvisibility=hidden -Wall ) diff --git a/include/assimp/types.h b/include/assimp/types.h index 22ca7abdc..604591402 100644 --- a/include/assimp/types.h +++ b/include/assimp/types.h @@ -50,6 +50,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include #include // Our compile configuration diff --git a/tools/assimp_view/CMakeLists.txt b/tools/assimp_view/CMakeLists.txt index 655a38571..ebca500b3 100644 --- a/tools/assimp_view/CMakeLists.txt +++ b/tools/assimp_view/CMakeLists.txt @@ -43,8 +43,11 @@ ADD_EXECUTABLE( assimp_viewer WIN32 SET_PROPERTY(TARGET assimp_viewer PROPERTY DEBUG_POSTFIX ${ASSIMP_DEBUG_POSTFIX}) -ADD_DEFINITIONS( -D_SCL_SECURE_NO_WARNINGS ) -ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS ) + +IF ( MSVC ) + ADD_DEFINITIONS( -D_SCL_SECURE_NO_WARNINGS ) + ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS ) +ENDIF ( MSVC ) # @@ -54,7 +57,7 @@ ADD_CUSTOM_COMMAND(TARGET assimp_viewer MAIN_DEPENDENCY assimp) # Link the executable to the assimp + dx libs. -TARGET_LINK_LIBRARIES ( assimp_viewer assimp ${DirectX_LIBRARY} ${DirectX_D3DX9_LIBRARY} comctl32.lib Winmm.lib ) +TARGET_LINK_LIBRARIES ( assimp_viewer assimp ${DirectX_LIBRARY} ${DirectX_D3DX9_LIBRARY} comctl32.lib winmm.lib ) INSTALL( TARGETS assimp_viewer DESTINATION "${ASSIMP_BIN_INSTALL_DIR}" COMPONENT assimp-dev diff --git a/tools/assimp_view/HelpDialog.cpp b/tools/assimp_view/HelpDialog.cpp index a7e700ab8..7e0e5ddfe 100644 --- a/tools/assimp_view/HelpDialog.cpp +++ b/tools/assimp_view/HelpDialog.cpp @@ -42,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "stdafx.h" #include "assimp_view.h" -#include "RICHEDIT.H" +#include "richedit.h" namespace AssimpView { diff --git a/tools/assimp_view/LogWindow.cpp b/tools/assimp_view/LogWindow.cpp index ad6b235cd..c073028eb 100644 --- a/tools/assimp_view/LogWindow.cpp +++ b/tools/assimp_view/LogWindow.cpp @@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "stdafx.h" #include "assimp_view.h" -#include "RichEdit.h" +#include "richedit.h" namespace AssimpView { diff --git a/tools/assimp_view/MessageProc.cpp b/tools/assimp_view/MessageProc.cpp index 44d38568d..54976f2b3 100644 --- a/tools/assimp_view/MessageProc.cpp +++ b/tools/assimp_view/MessageProc.cpp @@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "stdafx.h" #include "assimp_view.h" -#include +#include namespace AssimpView { diff --git a/tools/assimp_view/stdafx.h b/tools/assimp_view/stdafx.h index c6d14ceb4..0fda71111 100644 --- a/tools/assimp_view/stdafx.h +++ b/tools/assimp_view/stdafx.h @@ -44,14 +44,14 @@ #include #include -#include +#include // ShellExecute() #include #include // GetOpenFileName() -#include +#include #include #include