mirror of
https://github.com/PixarAnimationStudios/OpenSubdiv
synced 2025-01-08 07:40:17 +00:00
Merge pull request #917 from davidgyu/dev_fix_static_crt_776
Added option to build using MSVC with static CRT.
This commit is contained in:
commit
567bedbd4d
@ -244,11 +244,24 @@ elseif(MSVC)
|
|||||||
#/D_HAS_ITERATOR_DEBUGGING=0
|
#/D_HAS_ITERATOR_DEBUGGING=0
|
||||||
)
|
)
|
||||||
|
|
||||||
# Turn off a duplicate LIBCMT linker warning
|
option(MSVC_STATIC_CRT "Statically link MSVC CRT" OFF)
|
||||||
set(CMAKE_EXE_LINKER_FLAGS
|
|
||||||
"${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:libcmt.lib")
|
if(MSVC_STATIC_CRT)
|
||||||
set(CMAKE_SHARED_LINKER_FLAGS
|
message(STATUS "Using static MSVC CRT")
|
||||||
"${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB:libcmt.lib")
|
# http://stackoverflow.com/a/32128977/486990
|
||||||
|
add_compile_options(
|
||||||
|
"$<$<CONFIG:Debug>:/MTd>"
|
||||||
|
"$<$<CONFIG:RelWithDebInfo>:/MT>"
|
||||||
|
"$<$<CONFIG:Release>:/MT>"
|
||||||
|
"$<$<CONFIG:MinSizeRel>:/MT>"
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
# Turn off a duplicate LIBCMT linker warning
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS
|
||||||
|
"${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:libcmt.lib")
|
||||||
|
set(CMAKE_SHARED_LINKER_FLAGS
|
||||||
|
"${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB:libcmt.lib")
|
||||||
|
endif()
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user