Browse Source

Fixed mingw cross compiler issues.

Marcel Metz 12 years ago
parent
commit
93fd1133ff

+ 1 - 1
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 )

+ 1 - 0
include/assimp/types.h

@@ -50,6 +50,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include <memory.h>
 #include <math.h>
 #include <stddef.h>
+#include <string.h>
 #include <limits.h>
 
 // Our compile configuration

+ 6 - 3
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

+ 1 - 1
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 {
 

+ 1 - 1
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 {
 

+ 1 - 1
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 <Windowsx.h>
+#include <windowsx.h>
 
 namespace AssimpView {
 

+ 2 - 2
tools/assimp_view/stdafx.h

@@ -44,14 +44,14 @@
 
 #include <d3d9.h>
 #include <d3dx9.h>
-#include <D3DX9Mesh.h>
+#include <d3dx9mesh.h>
 
 // ShellExecute()
 #include <shellapi.h>
 #include <commctrl.h>
 
 // GetOpenFileName()
-#include <Commdlg.h>
+#include <commdlg.h>
 #include <algorithm>
 #include <mmsystem.h>