Skip to content

Commit 305c0a0

Browse files
committed
When adding conditionally included compiler flags, dont use the CFLAGS section.
- cmake/modules/SwiftSupport.cmake prepends each flag with '-Xcc' but if the flag evaluates to empty then an extra -Xcc is added to the compiler options. - Explicitly add the option with a conditional '-Xcc' before it as well. - This fixes the "warning: argument unused during compilation: '-Xcc'" seen in the error logs.
1 parent 7784917 commit 305c0a0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,6 @@ if(ENABLE_SWIFT)
124124
CFLAGS
125125
-fblocks
126126
-fmodule-map-file=${PROJECT_SOURCE_DIR}/dispatch/module.modulemap
127-
$<$<PLATFORM_ID:Windows>:-D_MT>
128-
# TODO(compnerd) handle /MT builds
129-
$<$<PLATFORM_ID:Windows>:-D_DLL>
130127
DEPENDS
131128
module-maps
132129
DispatchStubs
@@ -158,6 +155,11 @@ if(ENABLE_SWIFT)
158155
SWIFT_FLAGS
159156
-I ${PROJECT_SOURCE_DIR}
160157
${swift_optimization_flags}
158+
$<$<PLATFORM_ID:Windows>:-Xcc>
159+
$<$<PLATFORM_ID:Windows>:-D_MT>
160+
# TODO(compnerd) handle /MT builds
161+
$<$<PLATFORM_ID:Windows>:-Xcc>
162+
$<$<PLATFORM_ID:Windows>:-D_DLL>
161163
TARGET
162164
${CMAKE_C_COMPILER_TARGET})
163165
endif()

0 commit comments

Comments
 (0)