File tree 1 file changed +11
-0
lines changed
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_BUILD})
12
12
set (VERSION_STR ${VERSION} )
13
13
math (EXPR VERSION_INT "${VERSION_MAJOR} << 8 | ${VERSION_MINOR} " )
14
14
15
+ option (FORCE_STATIC_VCRT "Force static VC runtime" ON )
16
+
15
17
# check for optional include files
16
18
include (CheckIncludeFile)
17
19
check_include_file("unistd.h" HAVE_UNISTD_H)
@@ -162,6 +164,15 @@ if(MSVC)
162
164
${PROJECT_BINARY_DIR} /\${CMAKE_INSTALL_CONFIG_NAME} /pawncc.pdb
163
165
${PROJECT_BINARY_DIR} /\${CMAKE_INSTALL_CONFIG_NAME} /pawndisasm.pdb
164
166
DESTINATION bin)
167
+ # Force static runtime library
168
+ if (FORCE_STATIC_VCRT)
169
+ target_compile_options (pawnc PRIVATE
170
+ $<$<OR :$<CONFIG:Release>,$<CONFIG:MinSizeRel>>:/MT>
171
+ $<$<OR :$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:/MTd>)
172
+ target_compile_options (pawncc PRIVATE
173
+ $<$<OR :$<CONFIG:Release>,$<CONFIG:MinSizeRel>>:/MT>
174
+ $<$<OR :$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:/MTd>)
175
+ endif ()
165
176
endif ()
166
177
167
178
# Generate targets for running compiler tests
You can’t perform that action at this time.
0 commit comments