-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
62 lines (58 loc) · 1.97 KB
/
Copy pathCMakeLists.txt
File metadata and controls
62 lines (58 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
file(TO_CMAKE_PATH "$ENV{WindowsSdkDir}" WindowsSdkDir)
file(TO_CMAKE_PATH "$ENV{WindowsSDKVersion}" WindowsSDKVersion)
file(TO_CMAKE_PATH "$ENV{UniversalCRTSdkDir}" UniversalCRTSdkDir)
file(TO_CMAKE_PATH "$ENV{UCRTVersion}" UCRTVersion)
file(TO_CMAKE_PATH "$ENV{VCToolsInstallDir}" VCToolsInstallDir)
file(CONFIGURE
OUTPUT windows-sdk-overlay.yaml
CONTENT [[
---
version: 0
case-sensitive: false
use-external-names: true
roots:
- name: "@WindowsSdkDir@/Include/@WindowsSDKVersion@/um"
type: directory
contents:
- name: module.modulemap
type: file
external-contents: "@CMAKE_CURRENT_SOURCE_DIR@/winsdk_um.modulemap"
- name: WinSDK.apinotes
type: file
external-contents: "@CMAKE_CURRENT_SOURCE_DIR@/WinSDK.apinotes"
- name: "@WindowsSdkDir@/Include/@WindowsSDKVersion@/shared"
type: directory
contents:
- name: module.modulemap
type: file
external-contents: "@CMAKE_CURRENT_SOURCE_DIR@/winsdk_shared.modulemap"
- name: "@UniversalCRTSdkDir@/Include/@UCRTVersion@/ucrt"
type: directory
contents:
- name: module.modulemap
type: file
external-contents: "@CMAKE_CURRENT_SOURCE_DIR@/ucrt.modulemap"
- name: "@VCToolsInstallDir@/include"
type: directory
contents:
- name: module.modulemap
type: file
external-contents: "@CMAKE_CURRENT_SOURCE_DIR@/vcruntime.modulemap"
- name: vcruntime.apinotes
type: file
external-contents: "@CMAKE_CURRENT_SOURCE_DIR@/vcruntime.apinotes"
]]
ESCAPE_QUOTES @ONLY NEWLINE_STYLE LF)
add_library(ClangModules INTERFACE)
target_compile_options(ClangModules INTERFACE
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-vfsoverlay ${CMAKE_CURRENT_BINARY_DIR}/windows-sdk-overlay.yaml>")
install(TARGETS ClangModules
EXPORT SwiftOverlayTargets)
install(FILES
ucrt.modulemap
WinSDK.apinotes
vcruntime.apinotes
vcruntime.modulemap
winsdk_um.modulemap
winsdk_shared.modulemap
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR})