Skip to content

Commit b0005e9

Browse files
committed
build: remove C_COMPILE_FLAGS from add_swift_host_library
Use the appropriate CMake mechanism for controlling flags for building the code.
1 parent 6d446bd commit b0005e9

File tree

4 files changed

+22
-25
lines changed

4 files changed

+22
-25
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1358,7 +1358,6 @@ endfunction()
13581358
# [SWIFT_MODULE_DEPENDS dep1 ...]
13591359
# [LLVM_COMPONENT_DEPENDS comp1 ...]
13601360
# [FILE_DEPENDS target1 ...]
1361-
# [C_COMPILE_FLAGS flag1...]
13621361
# [LINK_FLAGS flag1...]
13631362
# [INSTALL]
13641363
# INSTALL_IN_COMPONENT comp
@@ -1382,9 +1381,6 @@ endfunction()
13821381
# FILE_DEPENDS
13831382
# Additional files this library depends on.
13841383
#
1385-
# C_COMPILE_FLAGS
1386-
# Extra compiler flags (C, C++, ObjC).
1387-
#
13881384
# LINK_FLAGS
13891385
# Extra linker flags.
13901386
#
@@ -1415,6 +1411,9 @@ function(add_swift_host_library name)
14151411
${ARGN})
14161412
set(ASHL_SOURCES ${ASHL_UNPARSED_ARGUMENTS})
14171413

1414+
if(ASHL_C_COMPILE_FLAGS)
1415+
message(SEND_ERROR "library ${name} is using C_COMPILE_FLAGS parameter which is deprecated. Please use target_compile_definitions, target_compile_options, or target_include_directories instead")
1416+
endif()
14181417
if(ASHL_LINK_LIBRARIES)
14191418
message(SEND_ERROR "library ${name} is using LINK_LIBRARIES parameter which is deprecated. Please use target_link_libraries instead")
14201419
endif()
@@ -1437,7 +1436,6 @@ function(add_swift_host_library name)
14371436
DEPENDS ${ASHL_DEPENDS}
14381437
LLVM_COMPONENT_DEPENDS ${ASHL_LLVM_COMPONENT_DEPENDS}
14391438
FILE_DEPENDS ${ASHL_FILE_DEPENDS}
1440-
C_COMPILE_FLAGS ${ASHL_C_COMPILE_FLAGS}
14411439
LINK_FLAGS ${ASHL_LINK_FLAGS}
14421440
INTERFACE_LINK_LIBRARIES ${ASHL_INTERFACE_LINK_LIBRARIES}
14431441
INSTALL_IN_COMPONENT "dev"

lib/Basic/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,9 @@ add_swift_host_library(swiftBasic STATIC
104104

105105
UnicodeExtendedGraphemeClusters.cpp.gyb
106106

107-
C_COMPILE_FLAGS ${UUID_INCLUDE}
108107
LLVM_COMPONENT_DEPENDS support)
108+
target_include_directories(swiftBasic PRIVATE
109+
${UUID_INCLUDE})
109110

110111
if(NOT SWIFT_BUILD_ONLY_SYNTAXPARSERLIB)
111112
target_link_libraries(swiftBasic PRIVATE

lib/Demangling/CMakeLists.txt

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
add_swift_host_library(swiftDemangling
2-
STATIC
3-
Demangler.cpp
4-
Context.cpp
5-
ManglingUtils.cpp
6-
NodeDumper.cpp
7-
NodePrinter.cpp
8-
OldDemangler.cpp
9-
OldRemangler.cpp
10-
Punycode.cpp
11-
Remangler.cpp
12-
C_COMPILE_FLAGS
13-
-DLLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING=1)
1+
add_swift_host_library(swiftDemangling STATIC
2+
Demangler.cpp
3+
Context.cpp
4+
ManglingUtils.cpp
5+
NodeDumper.cpp
6+
NodePrinter.cpp
7+
OldDemangler.cpp
8+
OldRemangler.cpp
9+
Punycode.cpp
10+
Remangler.cpp)
11+
target_compile_definitions(swiftDemangling PRIVATE
12+
LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING=1)
1413

lib/SwiftDemangle/CMakeLists.txt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
add_swift_host_library(swiftDemangle
2-
SHARED
3-
SwiftDemangle.cpp
4-
MangleHack.cpp
5-
C_COMPILE_FLAGS
6-
-DLLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING=1)
1+
add_swift_host_library(swiftDemangle SHARED
2+
SwiftDemangle.cpp
3+
MangleHack.cpp)
4+
target_compile_definitions(swiftDemangle PRIVATE
5+
LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING=1)
76
target_link_libraries(swiftDemangle PRIVATE
87
swiftDemangling)
98

0 commit comments

Comments
 (0)