Skip to content

Commit b580e7c

Browse files
committed
Runtimes: create an Overlay project
This sets up the scaffolding for an Overlay project to allow building platform specific overlays.
1 parent b5eec98 commit b580e7c

File tree

4 files changed

+64
-1
lines changed

4 files changed

+64
-1
lines changed

Runtimes/Overlay/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
cmake_minimum_required(VERSION 3.26...3.29)
2+
3+
project(SwiftOverlay LANGAUGES C VERSION 6.1)
4+
5+
if(WIN32)
6+
add_subdirectory(Windows)
7+
endif()
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
include(GNUInstallDirs)
3+
4+
add_subdirectory(clang)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
install(FILES
3+
ucrt.modulemap
4+
vcruntime.apinotes
5+
vcruntime.modulemap
6+
winsdk.modulemap
7+
DESTINATION ${CMAKE_INSTALL_PREFIX}/share)

Runtimes/Resync.cmake

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,52 @@ file(COPY_FILE
6868
ONLY_IF_DIFFERENT)
6969
if(_output)
7070
message(SEND_ERROR
71-
"Copy ${StdlibSources}/Info.plist.in] -> Core/Info.plist.in Failed: ${_output}")
71+
"Copy ${StdlibSources}/Info.plist.in -> Core/Info.plist.in Failed: ${_output}")
72+
endif()
73+
74+
# Copy Windows clang overlays
75+
message(STATUS "modulemap[${StdlibSources}/Windows/ucrt.modulemap] -> Overlay/Windows/clang")
76+
file(COPY_FILE
77+
"${StdlibSources}/Platform/ucrt.modulemap" # From
78+
"${CMAKE_CURRENT_LIST_DIR}/Overlay/Windows/clang/ucrt.modulemap" # To
79+
RESULT _output
80+
ONLY_IF_DIFFERENT)
81+
if(_output)
82+
message(SEND_ERROR
83+
"Copy ${StdlibSources}/Platform/ucrt.modulemap -> Overlay/Windows/clang/ucrt.modulemap Failed: ${_output}")
84+
endif()
85+
86+
message(STATUS "modulemap[${StdlibSources}/Windows/winsdk.modulemap] -> Overlay/Windows/clang")
87+
file(COPY_FILE
88+
"${StdlibSources}/Platform/winsdk.modulemap" # From
89+
"${CMAKE_CURRENT_LIST_DIR}/Overlay/Windows/clang/winsdk.modulemap" # To
90+
RESULT _output
91+
ONLY_IF_DIFFERENT)
92+
if(_output)
93+
message(SEND_ERROR
94+
"Copy ${StdlibSources}/Platform/winsdk.modulemap -> Overlay/Windows/clang/winsdk.modulemap Failed: ${_output}")
95+
endif()
96+
97+
message(STATUS "modulemap[${StdlibSources}/Windows/vcruntime.modulemap] -> Overlay/Windows/clang")
98+
file(COPY_FILE
99+
"${StdlibSources}/Platform/vcruntime.modulemap" # From
100+
"${CMAKE_CURRENT_LIST_DIR}/Overlay/Windows/clang/vcruntime.modulemap" # To
101+
RESULT _output
102+
ONLY_IF_DIFFERENT)
103+
if(_output)
104+
message(SEND_ERROR
105+
"Copy ${StdlibSources}/Platform/vcruntime.modulemap -> Overlay/Windows/clang/vcruntime.modulemap Failed: ${_output}")
106+
endif()
107+
108+
message(STATUS "APINotes[${StdlibSources}/Windows/vcruntime.apinotes] -> Overlay/Windows/clang")
109+
file(COPY_FILE
110+
"${StdlibSources}/Platform/vcruntime.apinotes" # From
111+
"${CMAKE_CURRENT_LIST_DIR}/Overlay/Windows/clang/vcruntime.apinotes" # To
112+
RESULT _output
113+
ONLY_IF_DIFFERENT)
114+
if(_output)
115+
message(SEND_ERROR
116+
"Copy ${StdlibSources}/Platform/vcruntime.apinotes -> Overlay/Windows/clang/vcruntime.modulemap Failed: ${_output}")
72117
endif()
73118

74119
set(CoreLibs

0 commit comments

Comments
 (0)