Skip to content

Commit aa7cb0e

Browse files
committed
Add CFLAGS back in for windows.
1 parent 7c291af commit aa7cb0e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

cmake/external_rules.cmake

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,9 @@ function(build_external_dependencies)
153153
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
154154
set(CMAKE_SUB_BUILD_OPTIONS ${CMAKE_SUB_BUILD_OPTIONS}
155155
--config Debug)
156+
else
157+
set(CMAKE_SUB_BUILD_OPTIONS ${CMAKE_SUB_BUILD_OPTIONS}
158+
--config Release)
156159
endif()
157160
if(MSVC_RUNTIME_LIBRARY_STATIC)
158161
set(CMAKE_SUB_CONFIGURE_OPTIONS ${CMAKE_SUB_CONFIGURE_OPTIONS}
@@ -162,9 +165,13 @@ function(build_external_dependencies)
162165
-DCMAKE_CXX_FLAGS_DEBUG="/MTd")
163166
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
164167
set(CMAKE_SUB_CONFIGURE_OPTIONS ${CMAKE_SUB_CONFIGURE_OPTIONS}
168+
-DCMAKE_C_FLAGS="/MTd"
169+
-DCMAKE_CXX_FLAGS="/MTd"
165170
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebug)
166171
else()
167172
set(CMAKE_SUB_CONFIGURE_OPTIONS ${CMAKE_SUB_CONFIGURE_OPTIONS}
173+
-DCMAKE_C_FLAGS="/MT"
174+
-DCMAKE_CXX_FLAGS="/MT"
168175
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded)
169176
endif()
170177
else() # dynamic (DLL) runtime
@@ -175,9 +182,13 @@ function(build_external_dependencies)
175182
-DCMAKE_CXX_FLAGS_DEBUG="/MDd")
176183
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
177184
set(CMAKE_SUB_CONFIGURE_OPTIONS ${CMAKE_SUB_CONFIGURE_OPTIONS}
185+
-DCMAKE_C_FLAGS="/MDd"
186+
-DCMAKE_CXX_FLAGS="/MDd"
178187
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebugDLL)
179188
else()
180189
set(CMAKE_SUB_CONFIGURE_OPTIONS ${CMAKE_SUB_CONFIGURE_OPTIONS}
190+
-DCMAKE_C_FLAGS="/MD"
191+
-DCMAKE_CXX_FLAGS="/MD"
181192
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL)
182193
endif()
183194
endif()

0 commit comments

Comments
 (0)