Revision 70d2abaa53616af35c7857bf8f52c8a234f150ff authored by X.ZhaoMa on 27 January 2021, 15:43:51 UTC, committed by GitHub on 27 January 2021, 15:43:51 UTC
1 parent 780a5fb
LibiglWindows.cmake
if(MSVC)
option(IGL_STATIC_RUNTIME "Use libigl with the static MSVC runtime." OFF)
if(IGL_STATIC_RUNTIME)
message(STATUS "MSVC -> forcing use of statically-linked runtime.")
foreach(config ${CMAKE_CONFIGURATION_TYPES})
string(TOUPPER ${config} config)
string(REPLACE /MD /MT CMAKE_C_FLAGS_${config} "${CMAKE_C_FLAGS_${config}}")
string(REPLACE /MD /MT CMAKE_CXX_FLAGS_${config} "${CMAKE_CXX_FLAGS_${config}}")
endforeach()
string(REPLACE "/MDd" "/MTd" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
else()
message(STATUS "MSVC -> forcing use of dynamically-linked runtime.")
foreach(config ${CMAKE_CONFIGURATION_TYPES})
string(TOUPPER ${config} config)
string(REPLACE /MT /MD CMAKE_C_FLAGS_${config} "${CMAKE_C_FLAGS_${config}}")
string(REPLACE /MT /MD CMAKE_CXX_FLAGS_${config} "${CMAKE_CXX_FLAGS_${config}}")
endforeach()
string(REPLACE "/MTd" "/MDd" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
endif()
# https://github.com/mozilla/sccache/issues/242
if(CMAKE_CXX_COMPILER_LAUNCHER STREQUAL "sccache")
string(REGEX REPLACE "/Z[iI7]" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Z7")
endif()
endif()

Computing file changes ...