Skip to content

[CMake] Allow *only* static stdlib to be built #2431

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

Closed
Closed
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
32 changes: 24 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,34 @@ option(SWIFT_BUILD_TOOLS
"Build the Swift compiler and other tools"
TRUE)

option(SWIFT_BUILD_STDLIB
"Build the Swift standard library (independent of the SDK headers)"
option(SWIFT_BUILD_DYNAMIC_STDLIB
"Build dynamic variants of the Swift standard library"
TRUE)

option(SWIFT_BUILD_SDK_OVERLAY
"Build Swift SDK overlay"
option(SWIFT_BUILD_STATIC_STDLIB
"Build static variants of the Swift standard library"
FALSE)

if(SWIFT_BUILD_DYNAMIC_STDLIB OR SWIFT_BUILD_STATIC_STDLIB)
set(SWIFT_BUILD_STDLIB TRUE)
else()
set(SWIFT_BUILD_STDLIB FALSE)
endif()
Copy link
Contributor

@gribozavr gribozavr May 9, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So setting SWIFT_BUILD_STDLIB like this would not be correct, since in the build that just builds just the SDK overlay both SWIFT_BUILD_DYNAMIC_STDLIB and SWIFT_BUILD_STATIC_STDLIB would be set.


option(SWIFT_BUILD_DYNAMIC_SDK_OVERLAY
"Build dynamic variants of the Swift SDK overlays"
TRUE)

option(SWIFT_BUILD_STATIC_STDLIB
"Build static variants of the Swift standard library and SDK overlay"
option(SWIFT_BUILD_STATIC_SDK_OVERLAY
"Build static variants of the Swift SDK overlays"
FALSE)

if(SWIFT_BUILD_DYNAMIC_SDK_OVERLAY OR SWIFT_BUILD_STATIC_SDK_OVERLAY)
set(SWIFT_BUILD_SDK_OVERLAY TRUE)
else()
set(SWIFT_BUILD_SDK_OVERLAY FALSE)
endif()

option(SWIFT_BUILD_PERF_TESTSUITE
"Create targets for swift performance benchmarks."
FALSE)
Expand Down Expand Up @@ -795,14 +811,14 @@ if(SWIFT_BUILD_TOOLS)
endif()

is_sdk_requested("${SWIFT_HOST_VARIANT_SDK}" SWIFT_HOST_SDK_REQUESTED)
if(SWIFT_BUILD_TOOLS AND SWIFT_BUILD_STDLIB AND SWIFT_HOST_SDK_REQUESTED)
if(SWIFT_BUILD_TOOLS AND SWIFT_BUILD_DYNAMIC_STDLIB AND SWIFT_HOST_SDK_REQUESTED)
add_subdirectory(tools/swift-reflection-dump)
endif()

add_subdirectory(utils)
add_subdirectory(stdlib)

if(SWIFT_BUILD_STDLIB AND SWIFT_INCLUDE_TESTS)
if(SWIFT_BUILD_DYNAMIC_STDLIB AND SWIFT_INCLUDE_TESTS)
add_subdirectory(tools/swift-reflection-test)
endif()

Expand Down
Loading