Merge pull request #4311 from SirLynix/fix-mingw
CMake: Replace CMAKE_COMPILER_IS_MINGW by MINGWpull/4259/head^2
commit
c882731688
|
@ -246,7 +246,7 @@ IF( UNIX )
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
# Grouped compiler settings ########################################
|
# Grouped compiler settings ########################################
|
||||||
IF ((CMAKE_C_COMPILER_ID MATCHES "GNU") AND NOT CMAKE_COMPILER_IS_MINGW)
|
IF ((CMAKE_C_COMPILER_ID MATCHES "GNU") AND NOT MINGW)
|
||||||
IF(NOT ASSIMP_HUNTER_ENABLED)
|
IF(NOT ASSIMP_HUNTER_ENABLED)
|
||||||
SET(CMAKE_CXX_STANDARD 11)
|
SET(CMAKE_CXX_STANDARD 11)
|
||||||
SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||||
|
@ -283,7 +283,7 @@ ELSEIF (CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
|
||||||
ENDIF()
|
ENDIF()
|
||||||
SET(CMAKE_CXX_FLAGS "-fvisibility=hidden -fno-strict-aliasing -Wall -Wno-long-long ${CMAKE_CXX_FLAGS}" )
|
SET(CMAKE_CXX_FLAGS "-fvisibility=hidden -fno-strict-aliasing -Wall -Wno-long-long ${CMAKE_CXX_FLAGS}" )
|
||||||
SET(CMAKE_C_FLAGS "-fno-strict-aliasing ${CMAKE_C_FLAGS}")
|
SET(CMAKE_C_FLAGS "-fno-strict-aliasing ${CMAKE_C_FLAGS}")
|
||||||
ELSEIF( CMAKE_COMPILER_IS_MINGW )
|
ELSEIF( MINGW )
|
||||||
IF (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)
|
IF (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)
|
||||||
message(FATAL_ERROR "MinGW is too old to be supported. Please update MinGW and try again.")
|
message(FATAL_ERROR "MinGW is too old to be supported. Please update MinGW and try again.")
|
||||||
ELSEIF(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.3)
|
ELSEIF(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.3)
|
||||||
|
|
|
@ -557,7 +557,7 @@ ADD_ASSIMP_IMPORTER( IFC
|
||||||
if (ASSIMP_BUILD_IFC_IMPORTER)
|
if (ASSIMP_BUILD_IFC_IMPORTER)
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
set_source_files_properties(Importer/IFC/IFCReaderGen1_2x3.cpp Importer/IFC/IFCReaderGen2_2x3.cpp PROPERTIES COMPILE_FLAGS "/bigobj")
|
set_source_files_properties(Importer/IFC/IFCReaderGen1_2x3.cpp Importer/IFC/IFCReaderGen2_2x3.cpp PROPERTIES COMPILE_FLAGS "/bigobj")
|
||||||
elseif(CMAKE_COMPILER_IS_MINGW)
|
elseif(MINGW)
|
||||||
set_source_files_properties(Importer/IFC/IFCReaderGen1_2x3.cpp Importer/IFC/IFCReaderGen2_2x3.cpp PROPERTIES COMPILE_FLAGS "-O2 -Wa,-mbig-obj")
|
set_source_files_properties(Importer/IFC/IFCReaderGen1_2x3.cpp Importer/IFC/IFCReaderGen2_2x3.cpp PROPERTIES COMPILE_FLAGS "-O2 -Wa,-mbig-obj")
|
||||||
endif()
|
endif()
|
||||||
endif ()
|
endif ()
|
||||||
|
@ -862,7 +862,7 @@ ADD_ASSIMP_IMPORTER( MMD
|
||||||
# optimizations that take up extra space. Given that the issue is a string table overflowing, -Os seemed appropriate
|
# optimizations that take up extra space. Given that the issue is a string table overflowing, -Os seemed appropriate
|
||||||
# Also, I'm not positive if both link & compile flags are needed, but this hopefully ensures that the issue should not
|
# Also, I'm not positive if both link & compile flags are needed, but this hopefully ensures that the issue should not
|
||||||
# recur for edge cases such as static builds.
|
# recur for edge cases such as static builds.
|
||||||
if ((CMAKE_COMPILER_IS_MINGW) AND (CMAKE_BUILD_TYPE MATCHES Debug))
|
if ((MINGW) AND (CMAKE_BUILD_TYPE MATCHES Debug))
|
||||||
message("-- Applying MinGW StepFileGen1.cpp Debug Workaround")
|
message("-- Applying MinGW StepFileGen1.cpp Debug Workaround")
|
||||||
SET_SOURCE_FILES_PROPERTIES(Importer/StepFile/StepFileGen1.cpp PROPERTIES COMPILE_FLAGS -Os )
|
SET_SOURCE_FILES_PROPERTIES(Importer/StepFile/StepFileGen1.cpp PROPERTIES COMPILE_FLAGS -Os )
|
||||||
SET_SOURCE_FILES_PROPERTIES(Importer/StepFile/StepFileGen1.cpp PROPERTIES LINK_FLAGS -Os )
|
SET_SOURCE_FILES_PROPERTIES(Importer/StepFile/StepFileGen1.cpp PROPERTIES LINK_FLAGS -Os )
|
||||||
|
|
|
@ -1616,6 +1616,7 @@ endif()
|
||||||
if( CMAKE_GENERATOR MATCHES "Ninja" AND CMAKE_HOST_WIN32 )
|
if( CMAKE_GENERATOR MATCHES "Ninja" AND CMAKE_HOST_WIN32 )
|
||||||
# it is a bad hack after all
|
# it is a bad hack after all
|
||||||
# CMake generates Ninja makefiles with UNIX paths only if it thinks that we are going to build with MinGW
|
# CMake generates Ninja makefiles with UNIX paths only if it thinks that we are going to build with MinGW
|
||||||
|
set( MINGW TRUE ) # tell CMake that we are MinGW
|
||||||
set( CMAKE_COMPILER_IS_MINGW TRUE ) # tell CMake that we are MinGW
|
set( CMAKE_COMPILER_IS_MINGW TRUE ) # tell CMake that we are MinGW
|
||||||
set( CMAKE_CROSSCOMPILING TRUE ) # stop recursion
|
set( CMAKE_CROSSCOMPILING TRUE ) # stop recursion
|
||||||
enable_language( C )
|
enable_language( C )
|
||||||
|
|
Loading…
Reference in New Issue