Skip to content

stdlib: install SwiftGlibc.h in static resources directory #62209

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
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
31 changes: 19 additions & 12 deletions stdlib/public/Platform/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,28 +146,35 @@ foreach(sdk ${SWIFT_SDKS})

list(APPEND glibc_modulemap_target_list ${glibc_modulemap_target})

set(glibc_header_out "${module_dir}/SwiftGlibc.h")
set(glibc_header_out_static "${module_dir_static}/SwiftGlibc.h")
handle_gyb_source_single(glibc_header_target
SOURCE "SwiftGlibc.h.gyb"
OUTPUT "${glibc_header_out}"
FLAGS "-DCMAKE_SDK=${sdk}")
list(APPEND glibc_modulemap_target_list ${glibc_header_target})

if(SWIFT_BUILD_STATIC_STDLIB)
add_custom_command_target(
copy_glibc_modulemap_static
copy_glibc_modulemap_header_static
COMMAND
"${CMAKE_COMMAND}" "-E" "make_directory" ${module_dir_static}
COMMAND
"${CMAKE_COMMAND}" "-E" "copy" ${glibc_modulemap_out} ${glibc_modulemap_out_static}
OUTPUT ${glibc_modulemap_out_static}
"${CMAKE_COMMAND}" "-E" "copy"
${glibc_modulemap_out} ${glibc_modulemap_out_static}
COMMAND
"${CMAKE_COMMAND}" "-E" "copy"
${glibc_header_out} ${glibc_header_out_static}
OUTPUT ${glibc_modulemap_out_static} ${glibc_header_out_static}
DEPENDS
"${glibc_modulemap_target}"
COMMENT "Copying Glibc modulemap to static resources")
"${glibc_header_target}"
COMMENT "Copying Glibc modulemap and header to static resources")

list(APPEND glibc_modulemap_target_list ${copy_glibc_modulemap_static})
list(APPEND glibc_modulemap_target_list
${copy_glibc_modulemap_header_static})
endif()

set(glibc_header_out "${module_dir}/SwiftGlibc.h")
handle_gyb_source_single(glibc_header_target
SOURCE "SwiftGlibc.h.gyb"
OUTPUT "${glibc_header_out}"
FLAGS "-DCMAKE_SDK=${sdk}")
list(APPEND glibc_modulemap_target_list ${glibc_header_target})

# If this SDK is a target for a non-native host, except if it's for Android
# with its own native sysroot, create a native modulemap without a sysroot
# prefix. This is the one we'll install instead.
Expand Down