|
1 | | -set(libstdcxx_modulemap_target_list) |
2 | | -foreach(sdk ${SWIFT_SDKS}) |
3 | | - if(NOT ${sdk} IN_LIST SWIFT_LIBSTDCXX_PLATFORMS) |
4 | | - continue() |
5 | | - endif() |
6 | | - |
7 | | - foreach(arch ${SWIFT_SDK_${sdk}_ARCHITECTURES}) |
8 | | - set(arch_suffix "${SWIFT_SDK_${sdk}_LIB_SUBDIR}-${arch}") |
9 | | - set(arch_subdir "${SWIFT_SDK_${sdk}_LIB_SUBDIR}/${arch}") |
10 | | - |
11 | | - set(module_dir "${SWIFTLIB_DIR}/${arch_subdir}") |
12 | | - set(module_dir_static "${SWIFTSTATICLIB_DIR}/${arch_subdir}") |
13 | | - |
14 | | - set(libstdcxx_header "libstdcxx.h") |
15 | | - set(libstdcxx_header_out "${module_dir}/libstdcxx.h") |
16 | | - set(libstdcxx_header_out_static "${module_dir_static}/libstdcxx.h") |
17 | | - set(libstdcxx_modulemap "libstdcxx.modulemap") |
18 | | - set(libstdcxx_modulemap_out "${module_dir}/libstdcxx.modulemap") |
19 | | - set(libstdcxx_modulemap_out_static "${module_dir_static}/libstdcxx.modulemap") |
20 | | - |
21 | | - add_custom_command_target( |
22 | | - copy_libstdcxx_modulemap |
23 | | - COMMAND |
24 | | - "${CMAKE_COMMAND}" "-E" "make_directory" ${module_dir} |
25 | | - COMMAND |
26 | | - "${CMAKE_COMMAND}" "-E" "copy_if_different" "${CMAKE_CURRENT_SOURCE_DIR}/${libstdcxx_modulemap}" "${libstdcxx_modulemap_out}" |
27 | | - OUTPUT ${libstdcxx_modulemap_out} |
28 | | - DEPENDS ${libstdcxx_modulemap} |
29 | | - COMMENT "Copying libstdcxx modulemap to resources") |
30 | | - list(APPEND libstdcxx_modulemap_target_list ${copy_libstdcxx_modulemap}) |
31 | | - add_dependencies(swift-stdlib-${arch_suffix} ${copy_libstdcxx_modulemap}) |
32 | | - |
33 | | - add_custom_command_target( |
34 | | - copy_libstdcxx_header |
35 | | - COMMAND |
36 | | - "${CMAKE_COMMAND}" "-E" "make_directory" ${module_dir} |
37 | | - COMMAND |
38 | | - "${CMAKE_COMMAND}" "-E" "copy_if_different" "${CMAKE_CURRENT_SOURCE_DIR}/${libstdcxx_header}" "${libstdcxx_header_out}" |
39 | | - OUTPUT ${libstdcxx_header_out} |
40 | | - DEPENDS ${libstdcxx_header} |
41 | | - COMMENT "Copying libstdcxx header to resources") |
42 | | - list(APPEND libstdcxx_modulemap_target_list ${copy_libstdcxx_header}) |
43 | | - add_dependencies(swift-stdlib-${arch_suffix} ${copy_libstdcxx_header}) |
44 | | - |
45 | | - if(SWIFT_BUILD_STATIC_STDLIB) |
46 | | - add_custom_command_target( |
47 | | - copy_libstdcxx_modulemap_static |
48 | | - COMMAND |
49 | | - "${CMAKE_COMMAND}" "-E" "make_directory" ${module_dir_static} |
50 | | - COMMAND |
51 | | - "${CMAKE_COMMAND}" "-E" "copy_if_different" |
52 | | - "${libstdcxx_modulemap_out}" "${libstdcxx_modulemap_out_static}" |
53 | | - OUTPUT ${libstdcxx_modulemap_out_static} |
54 | | - DEPENDS ${copy_libstdcxx_modulemap} |
55 | | - COMMENT "Copying libstdcxx modulemap to static resources") |
56 | | - list(APPEND libstdcxx_modulemap_target_list ${copy_libstdcxx_modulemap_static}) |
57 | | - add_dependencies(swift-stdlib-${arch_suffix} ${copy_libstdcxx_modulemap_static}) |
58 | | - |
59 | | - add_custom_command_target( |
60 | | - copy_libstdcxx_header_static |
61 | | - COMMAND |
62 | | - "${CMAKE_COMMAND}" "-E" "make_directory" ${module_dir_static} |
63 | | - COMMAND |
64 | | - "${CMAKE_COMMAND}" "-E" "copy_if_different" |
65 | | - "${libstdcxx_header_out}" "${libstdcxx_header_out_static}" |
66 | | - OUTPUT ${libstdcxx_header_out_static} |
67 | | - DEPENDS ${copy_libstdcxx_header} |
68 | | - COMMENT "Copying libstdcxx header to static resources") |
69 | | - list(APPEND libstdcxx_modulemap_target_list ${copy_libstdcxx_header_static}) |
70 | | - add_dependencies(swift-stdlib-${arch_suffix} ${copy_libstdcxx_header_static}) |
71 | | - endif() |
72 | | - |
73 | | - swift_install_in_component(FILES "${libstdcxx_modulemap_out}" |
74 | | - DESTINATION "lib/swift/${arch_subdir}" |
75 | | - COMPONENT sdk-overlay) |
76 | | - swift_install_in_component(FILES "${libstdcxx_header_out}" |
77 | | - DESTINATION "lib/swift/${arch_subdir}" |
78 | | - COMPONENT sdk-overlay) |
79 | | - |
80 | | - if(SWIFT_BUILD_STATIC_STDLIB) |
81 | | - swift_install_in_component(FILES "${libstdcxx_modulemap_out_static}" |
82 | | - DESTINATION "lib/swift_static/${arch_subdir}" |
83 | | - COMPONENT sdk-overlay) |
84 | | - swift_install_in_component(FILES "${libstdcxx_header_out_static}" |
85 | | - DESTINATION "lib/swift_static/${arch_subdir}" |
86 | | - COMPONENT sdk-overlay) |
87 | | - endif() |
88 | | - |
89 | | - if(${BOOTSTRAPPING_MODE} MATCHES "BOOTSTRAPPING.*") |
90 | | - foreach(bootstrapping "0" "1") |
91 | | - get_bootstrapping_path(bootstrapping_dir ${module_dir} ${bootstrapping}) |
92 | | - set(libstdcxx_modulemap_out_bootstrapping "${bootstrapping_dir}/libstdcxx.modulemap") |
93 | | - set(libstdcxx_header_out_bootstrapping "${bootstrapping_dir}/libstdcxx.h") |
94 | | - |
95 | | - add_custom_command_target(unused_var |
96 | | - COMMAND |
97 | | - "${CMAKE_COMMAND}" "-E" "make_directory" "${bootstrapping_dir}" |
98 | | - COMMAND |
99 | | - "${CMAKE_COMMAND}" "-E" "copy_if_different" |
100 | | - "${CMAKE_CURRENT_SOURCE_DIR}/${libstdcxx_modulemap}" "${libstdcxx_modulemap_out_bootstrapping}" |
101 | | - |
102 | | - CUSTOM_TARGET_NAME "copy-libstdcxx-modulemap-bootstrapping${bootstrapping}" |
103 | | - OUTPUT "${libstdcxx_modulemap_out_bootstrapping}" |
104 | | - DEPENDS ${libstdcxx_modulemap} |
105 | | - COMMENT "Copying libstdcxx modulemap to resources for bootstrapping${bootstrapping}") |
106 | | - |
107 | | - add_custom_command_target(unused_var |
108 | | - COMMAND |
109 | | - "${CMAKE_COMMAND}" "-E" "make_directory" "${bootstrapping_dir}" |
110 | | - COMMAND |
111 | | - "${CMAKE_COMMAND}" "-E" "copy_if_different" |
112 | | - "${CMAKE_CURRENT_SOURCE_DIR}/${libstdcxx_header}" "${libstdcxx_header_out_bootstrapping}" |
113 | | - |
114 | | - CUSTOM_TARGET_NAME "copy-libstdcxx-header-bootstrapping${bootstrapping}" |
115 | | - OUTPUT "${libstdcxx_header_out_bootstrapping}" |
116 | | - DEPENDS ${libstdcxx_header} |
117 | | - COMMENT "Copying libstdcxx header to resources for bootstrapping${bootstrapping}") |
118 | | - endforeach() |
119 | | - endif() |
120 | | - endforeach() |
121 | | -endforeach() |
122 | | -add_custom_target(libstdcxx-modulemap DEPENDS ${libstdcxx_modulemap_target_list}) |
123 | | -set_property(TARGET libstdcxx-modulemap PROPERTY FOLDER "Miscellaneous") |
124 | | -add_dependencies(sdk-overlay libstdcxx-modulemap) |
125 | | - |
126 | | - |
127 | 1 | # |
128 | 2 | # C++ Standard Library Overlay. |
129 | 3 | # |
|
0 commit comments