Skip to content

Runtimes: mark CommandLineSupporta as an OBJECT library #81597

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Runtimes/Core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,10 @@ add_subdirectory(Demangling)
add_subdirectory(Threading)
add_subdirectory(runtime)
add_subdirectory(stubs)
add_subdirectory(CommandLineSupport)
add_subdirectory(core)
if(SwiftCore_ENABLE_COMMANDLINE_SUPPORT)
add_subdirectory(CommandLineSupport)
endif()
if(SwiftCore_ENABLE_ONONESUPPORT)
add_subdirectory(SwiftOnoneSupport)
endif()
Expand Down
28 changes: 9 additions & 19 deletions Runtimes/Core/CommandLineSupport/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
if(SwiftCore_ENABLE_COMMANDLINE_SUPPORT)
add_library(swiftCommandLineSupport STATIC CommandLine.cpp)
target_include_directories(swiftCommandLineSupport PRIVATE
"${SwiftCore_SWIFTC_SOURCE_DIR}/include"
"${PROJECT_BINARY_DIR}/include")
target_compile_definitions(swiftCommandLineSupport PUBLIC
-DSWIFT_STDLIB_HAS_COMMANDLINE)
target_compile_definitions(swiftCommandLineSupport PRIVATE
$<$<BOOL:${BUILD_SHARED_LIBS}>:-DswiftCore_EXPORTS>)

target_link_libraries(swiftCommandLineSupport PRIVATE
swiftShims)

if(NOT BUILD_SHARED_LIBS)
install(TARGETS swiftCommandLineSupport
EXPORT SwiftCoreTargets
COMPONENT SwiftCore_runtime)
endif()
endif()
# TODO(etcwilde) migrate this into subdir subdirectory once the migration is
# completed.
target_sources(swiftCore PRIVATE
CommandLine.cpp)
target_compile_definitions(swiftCore PUBLIC
-DSWIFT_STDLIB_HAS_COMMANDLINE)
target_include_directories(swiftCore PRIVATE
"${SwiftCore_SWIFTC_SOURCE_DIR}/include"
"${PROJECT_BINARY_DIR}/include")
4 changes: 2 additions & 2 deletions Runtimes/Core/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@ if(NOT LINUX AND NOT ANDROID)
endif()

if(SwiftCore_ENABLE_COMMANDLINE_SUPPORT)
target_sources(swiftCore PRIVATE CommandLine.swift)
target_link_libraries(swiftCore PRIVATE swiftCommandLineSupport)
target_sources(swiftCore PRIVATE
CommandLine.swift)
endif()

if(SwiftCore_ENABLE_VECTOR_TYPES)
Expand Down