Fix MinGW compilation support
authorMika Rautio <mika.rautio@gmail.com>
Mon, 5 Dec 2016 11:01:16 +0000 (13:01 +0200)
committerMika Rautio <mika.rautio@gmail.com>
Mon, 5 Dec 2016 11:01:16 +0000 (13:01 +0200)
CMakeLists.txt

index 76a6d05..a8f3d24 100644 (file)
@@ -176,6 +176,7 @@ ELSEIF ( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -fvisibility=hidden -Wall -Wno-long-long -pedantic -std=c++11" )
 ELSEIF( CMAKE_COMPILER_IS_MINGW )
   SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -Wall -Wno-long-long -pedantic -std=c++11" )
+  add_definitions( -U__STRICT_ANSI__ )
 ENDIF()
 
 if (ASSIMP_COVERALLS)
@@ -329,7 +330,7 @@ ENDIF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER)
 
 ADD_SUBDIRECTORY( code/ )
 IF ( ASSIMP_BUILD_ASSIMP_TOOLS )
-  IF ( WIN32 )
+  IF ( WIN32 AND DirectX_D3DX9_LIBRARY )
     option ( ASSIMP_BUILD_ASSIMP_VIEW "If the Assimp view tool is built. (requires DirectX)" ${DirectX_FOUND} )
     IF ( ASSIMP_BUILD_ASSIMP_VIEW )
       ADD_SUBDIRECTORY( tools/assimp_view/ )