Skip to content

[CMake] Update CMake build to account for _CShims --> _FoundationCShims rename #696

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
Jun 24, 2024
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
2 changes: 1 addition & 1 deletion Sources/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
##
##===----------------------------------------------------------------------===##

add_subdirectory(_CShims)
add_subdirectory(_FoundationCShims)
add_subdirectory(FoundationMacros)
add_subdirectory(FoundationEssentials)
add_subdirectory(FoundationInternationalization)
4 changes: 2 additions & 2 deletions Sources/FoundationEssentials/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ target_compile_options(FoundationEssentials PRIVATE ${_SwiftFoundation_availabil
target_compile_options(FoundationEssentials PRIVATE -package-name "SwiftFoundation")

target_link_libraries(FoundationEssentials PUBLIC
_CShims
_FoundationCShims
_FoundationCollections)

if(NOT BUILD_SHARED_LIBS)
target_compile_options(FoundationEssentials PRIVATE
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -public-autolink-library -Xfrontend _CShims>")
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -public-autolink-library -Xfrontend _FoundationCShims>")
target_compile_options(FoundationEssentials PRIVATE
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -public-autolink-library -Xfrontend _FoundationCollections>")
endif()
Expand Down
4 changes: 2 additions & 2 deletions Sources/FoundationInternationalization/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ target_compile_options(FoundationInternationalization PRIVATE -package-name "Swi

target_link_libraries(FoundationInternationalization PUBLIC
FoundationEssentials
_CShims
_FoundationCShims
_FoundationICU)

if(NOT BUILD_SHARED_LIBS)
target_compile_options(FoundationInternationalization PRIVATE
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -public-autolink-library -Xfrontend _CShims>")
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -public-autolink-library -Xfrontend _FoundationCShims>")
target_compile_options(FoundationInternationalization PRIVATE
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -public-autolink-library -Xfrontend _FoundationICU>")
endif()
Expand Down
10 changes: 5 additions & 5 deletions Sources/_FoundationCShims/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
##
##===----------------------------------------------------------------------===##

add_library(_CShims STATIC
add_library(_FoundationCShims STATIC
platform_shims.c
string_shims.c
uuid.c)

target_include_directories(_CShims PUBLIC include)
target_include_directories(_FoundationCShims PUBLIC include)

set_property(GLOBAL APPEND PROPERTY SWIFT_FOUNDATION_EXPORTS _CShims)
set_property(GLOBAL APPEND PROPERTY SWIFT_FOUNDATION_EXPORTS _FoundationCShims)

if(BUILD_SHARED_LIBS)
set(install_directory swift)
Expand All @@ -31,11 +31,11 @@ endif()
install(DIRECTORY
include/
DESTINATION
lib/${install_directory}/_CShims)
lib/${install_directory}/_FoundationCShims)

if(NOT BUILD_SHARED_LIBS)
get_swift_host_os(swift_os)
install(TARGETS _CShims
install(TARGETS _FoundationCShims
ARCHIVE DESTINATION lib/${install_directory}/${swift_os}
LIBRARY DESTINATION lib/${install_directory}/${swift_os}
RUNTIME DESTINATION bin)
Expand Down