CMake: Replace CMAKE_COMPILER_IS_MINGW by MINGW
See https://discourse.cmake.org/t/cmake-compiler-is-mingw-removed/4539 and https://cmake.org/cmake/help/latest/variable/MINGW.htmlpull/4311/head
parent
54a8da1d55
commit
81fc50f612
|
@ -246,7 +246,7 @@ IF( UNIX )
|
|||
ENDIF()
|
||||
|
||||
# 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)
|
||||
SET(CMAKE_CXX_STANDARD 11)
|
||||
SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
|
@ -283,7 +283,7 @@ ELSEIF (CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
|
|||
ENDIF()
|
||||
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}")
|
||||
ELSEIF( CMAKE_COMPILER_IS_MINGW )
|
||||
ELSEIF( MINGW )
|
||||
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.")
|
||||
ELSEIF(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.3)
|
||||
|
|
|
@ -557,7 +557,7 @@ ADD_ASSIMP_IMPORTER( IFC
|
|||
if (ASSIMP_BUILD_IFC_IMPORTER)
|
||||
if (MSVC)
|
||||
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")
|
||||
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
|
||||
# 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.
|
||||
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")
|
||||
SET_SOURCE_FILES_PROPERTIES(Importer/StepFile/StepFileGen1.cpp PROPERTIES COMPILE_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 )
|
||||
# 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
|
||||
set( 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
|
||||
enable_language( C )
|
||||
|
|
Loading…
Reference in New Issue