Skip to content

Commit ac1685e

Browse files
authored
Merge pull request swiftlang#28348 from compnerd/ballantyne-syndrome
build: split out swiftReflection builds
2 parents eaad4fc + cb3365f commit ac1685e

File tree

4 files changed

+9
-27
lines changed

4 files changed

+9
-27
lines changed

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1095,7 +1095,6 @@ else()
10951095
# Some tools (e.g. swift-reflection-dump) rely on a host swiftReflection, so
10961096
# ensure we build that when building tools.
10971097
if(SWIFT_INCLUDE_TOOLS)
1098-
add_subdirectory(stdlib/public/Reflection)
10991098
add_subdirectory(stdlib/public/SwiftShims)
11001099
endif()
11011100
endif()

lib/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ add_subdirectory(RemoteAST)
3737
add_subdirectory(Sema)
3838
add_subdirectory(Serialization)
3939
add_subdirectory(SwiftDemangle)
40+
add_subdirectory(SwiftReflection)
4041
add_subdirectory(SIL)
4142
add_subdirectory(SILGen)
4243
add_subdirectory(SILOptimizer)

lib/SwiftReflection/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
add_swift_host_library(swiftReflection STATIC
3+
${SWIFT_SOURCE_DIR}/stdlib/public/Reflection/MetadataSource.cpp
4+
${SWIFT_SOURCE_DIR}/stdlib/public/Reflection/TypeLowering.cpp
5+
${SWIFT_SOURCE_DIR}/stdlib/public/Reflection/TypeRef.cpp
6+
${SWIFT_SOURCE_DIR}/stdlib/public/Reflection/TypeRefBuilder.cpp)
7+
target_link_libraries(swiftReflection PUBLIC
8+
swiftDemangling)

stdlib/public/Reflection/CMakeLists.txt

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -28,29 +28,3 @@ if(SWIFT_BUILD_STDLIB)
2828
INSTALL_IN_COMPONENT dev)
2929
endif()
3030

31-
# Build a specific version for the host with the host toolchain. This is going
32-
# to be used by tools (e.g. lldb)
33-
if(SWIFT_INCLUDE_TOOLS)
34-
if(NOT SWIFT_BUILD_STDLIB)
35-
add_custom_target(swiftReflection-${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR})
36-
endif()
37-
38-
if(NOT SWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER)
39-
set(CURRENT_CMAKE_C_COMPILER ${CMAKE_C_COMPILER})
40-
set(CURRENT_CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER})
41-
set(CMAKE_C_COMPILER ${HOST_CMAKE_C_COMPILER})
42-
set(CMAKE_CXX_COMPILER ${HOST_CMAKE_CXX_COMPILER})
43-
endif()
44-
45-
add_swift_host_library(swiftReflection STATIC
46-
${swiftReflection_SOURCES})
47-
target_compile_options(swiftReflection PRIVATE
48-
${SWIFT_RUNTIME_CXX_FLAGS})
49-
set_property(TARGET swiftReflection
50-
APPEND_STRING PROPERTY LINK_FLAGS ${SWIFT_RUNTIME_LINK_FLAGS})
51-
52-
if(NOT SWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER)
53-
set(CMAKE_C_COMPILER ${CURRENT_CMAKE_C_COMPILER})
54-
set(CMAKE_CXX_COMPILER ${CURRENT_CMAKE_CXX_COMPILER})
55-
endif()
56-
endif()

0 commit comments

Comments
 (0)