mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-01-18 15:15:56 +08:00
[svn-r23753] HDFFV-8461: Add Windows /MT support
This adds the UserMacros.cmake Windows /MT support file. Tested: local linux
This commit is contained in:
parent
f4a3f6412b
commit
6ca79dd149
3
MANIFEST
3
MANIFEST
@ -2396,6 +2396,9 @@
|
||||
./config/cmake/NSIS.template.in
|
||||
./config/cmake/NSIS.InstallOptions.ini.in
|
||||
|
||||
# CMake-specific User Files
|
||||
./config/cmake/UserMacros/Windows_MT.cmake
|
||||
|
||||
./CMakeLists.txt
|
||||
./CTestConfig.cmake
|
||||
./UserMacros.cmake
|
||||
|
39
config/cmake/UserMacros/Windows_MT.cmake
Normal file
39
config/cmake/UserMacros/Windows_MT.cmake
Normal file
@ -0,0 +1,39 @@
|
||||
########################################################
|
||||
# Include file for user options
|
||||
########################################################
|
||||
|
||||
# To use this option, copy both the macro and option code
|
||||
# into the root UserMacros.cmake file.
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Option to Build with Static CRT libraries on Windows
|
||||
#-------------------------------------------------------------------------------
|
||||
MACRO (TARGET_STATIC_CRT_FLAGS)
|
||||
IF (MSVC AND NOT BUILD_SHARED_LIBS)
|
||||
FOREACH (flag_var
|
||||
CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
|
||||
CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO
|
||||
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
|
||||
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
|
||||
IF (${flag_var} MATCHES "/MD")
|
||||
STRING (REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
|
||||
ENDIF (${flag_var} MATCHES "/MD")
|
||||
ENDFOREACH (flag_var)
|
||||
FOREACH (flag_var
|
||||
CMAKE_Fortran_FLAGS CMAKE_Fortran_FLAGS_DEBUG CMAKE_Fortran_FLAGS_RELEASE
|
||||
CMAKE_Fortran_FLAGS_MINSIZEREL CMAKE_Fortran_FLAGS_RELWITHDEBINFO)
|
||||
IF (${flag_var} MATCHES "/libs:dll")
|
||||
STRING (REGEX REPLACE "/libs:dll" "/libs:static" ${flag_var} "${${flag_var}}")
|
||||
ENDIF (${flag_var} MATCHES "/libs:dll")
|
||||
ENDFOREACH (flag_var)
|
||||
SET (WIN_COMPILE_FLAGS "/MT")
|
||||
SET (WIN_LINK_FLAGS "/NODEFAULTLIB:MSVCRT")
|
||||
ENDIF (MSVC AND NOT BUILD_SHARED_LIBS)
|
||||
ENDMACRO (TARGET_STATIC_CRT_FLAGS)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
OPTION (BUILD_STATIC_CRT_LIBS "Build With Static CRT Libraries" OFF)
|
||||
IF (BUILD_STATIC_CRT_LIBS)
|
||||
TARGET_STATIC_CRT_FLAGS ()
|
||||
ENDIF (BUILD_STATIC_CRT_LIBS)
|
||||
|
Loading…
Reference in New Issue
Block a user