Skip to content

Commit a061b6b

Browse files
spevansrokhinip
authored andcommitted
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. Signed-off-by: Kim Topley <ktopley@apple.com>
1 parent dd47f71 commit a061b6b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,6 @@ if(ENABLE_SWIFT)
123123
CFLAGS
124124
-fblocks
125125
-fmodule-map-file=${PROJECT_SOURCE_DIR}/dispatch/module.modulemap
126-
$<$<PLATFORM_ID:Windows>:-D_MT>
127-
# TODO(compnerd) handle /MT builds
128-
$<$<PLATFORM_ID:Windows>:-D_DLL>
129126
DEPENDS
130127
module-maps
131128
DispatchStubs
@@ -157,6 +154,11 @@ if(ENABLE_SWIFT)
157154
SWIFT_FLAGS
158155
-I ${PROJECT_SOURCE_DIR}
159156
${swift_optimization_flags}
157+
$<$<PLATFORM_ID:Windows>:-Xcc>
158+
$<$<PLATFORM_ID:Windows>:-D_MT>
159+
# TODO(compnerd) handle /MT builds
160+
$<$<PLATFORM_ID:Windows>:-Xcc>
161+
$<$<PLATFORM_ID:Windows>:-D_DLL>
160162
TARGET
161163
${CMAKE_C_COMPILER_TARGET})
162164
endif()
File renamed without changes.

0 commit comments

Comments
 (0)