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)
@@ -163,6 +165,15 @@ if(MSVC)
163
165
${PROJECT_BINARY_DIR} /\${CMAKE_INSTALL_CONFIG_NAME} /pawncc.pdb
164
166
${PROJECT_BINARY_DIR} /\${CMAKE_INSTALL_CONFIG_NAME} /pawndisasm.pdb
165
167
DESTINATION bin)
168
+ # Force static runtime library
169
+ if (FORCE_STATIC_VCRT)
170
+ target_compile_options (pawnc PRIVATE
171
+ $<$<OR :$<CONFIG:Release>,$<CONFIG:MinSizeRel>>:/MT>
172
+ $<$<OR :$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:/MTd>)
173
+ target_compile_options (pawncc PRIVATE
174
+ $<$<OR :$<CONFIG:Release>,$<CONFIG:MinSizeRel>>:/MT>
175
+ $<$<OR :$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:/MTd>)
176
+ endif ()
166
177
endif ()
167
178
168
179
# Generate targets for running compiler tests
You can’t perform that action at this time.
0 commit comments