Skip to content

Commit e564bdc

Browse files
authored
Merge pull request #6884 from hughbe/definitions-windows
Move Windows specific compiler definitions from _add_link_flags to _add_compile_flags
2 parents a43bebb + e2755c1 commit e564bdc

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

Diff for: cmake/modules/AddSwift.cmake

+11-11
Original file line numberDiff line numberDiff line change
@@ -125,17 +125,6 @@ function(_add_variant_c_compile_link_flags)
125125
"-B" "${SWIFT_ANDROID_PREBUILT_PATH}/arm-linux-androideabi/bin/")
126126
endif()
127127

128-
if("${CFLAGS_SDK}" STREQUAL "WINDOWS")
129-
list(APPEND result "-DLLVM_ON_WIN32")
130-
list(APPEND result "-D_CRT_SECURE_NO_WARNINGS")
131-
list(APPEND result "-D_CRT_NONSTDC_NO_WARNINGS")
132-
# TODO(compnerd) permit building for different families
133-
list(APPEND result "-D_CRT_USE_WINAPI_FAMILY_DESKTOP_APP")
134-
# TODO(compnerd) handle /MT
135-
list(APPEND result "-D_DLL")
136-
list(APPEND result "-fms-compatibility-version=1900")
137-
endif()
138-
139128
if(IS_DARWIN)
140129
# Check if there's a specific OS deployment version needed for this invocation
141130
if("${CFLAGS_SDK}" STREQUAL "OSX")
@@ -233,6 +222,17 @@ function(_add_variant_c_compile_flags)
233222
list(APPEND result -fno-pic)
234223
endif()
235224

225+
if("${CFLAGS_SDK}" STREQUAL "WINDOWS")
226+
list(APPEND result "-DLLVM_ON_WIN32")
227+
list(APPEND result "-D_CRT_SECURE_NO_WARNINGS")
228+
list(APPEND result "-D_CRT_NONSTDC_NO_WARNINGS")
229+
# TODO(compnerd) permit building for different families
230+
list(APPEND result "-D_CRT_USE_WINAPI_FAMILY_DESKTOP_APP")
231+
# TODO(compnerd) handle /MT
232+
list(APPEND result "-D_DLL")
233+
list(APPEND result "-fms-compatibility-version=1900")
234+
endif()
235+
236236
if(CFLAGS_ENABLE_ASSERTIONS)
237237
list(APPEND result "-UNDEBUG")
238238
else()

0 commit comments

Comments
 (0)