|
1 | 1 | add_subdirectory(swift)
|
2 | 2 |
|
| 3 | +if(SWIFT_INCLUDE_TOOLS) |
3 | 4 |
|
4 |
| -# Create a library that depends on all headers defined in include/swift/module.modulemap |
5 |
| -# |
6 |
| -# TODO: generate this dynamically through the modulemap; this cannot use `sed` |
7 |
| -# as that is not available on all platforms (e.g. Windows). |
8 |
| -file(GENERATE |
9 |
| - OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/HeaderDependencies.cpp" |
10 |
| - CONTENT " |
11 |
| -#define COMPILED_WITH_SWIFT |
12 |
| -#define SWIFT_TARGET |
| 5 | + # Create a library that depends on all tool headers defined in include/module.modulemap |
| 6 | + # |
| 7 | + # TODO: generate this dynamically through the modulemap; this cannot use `sed` |
| 8 | + # as that is not available on all platforms (e.g. Windows). |
| 9 | + file(GENERATE |
| 10 | + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/HeaderDependencies.cpp" |
| 11 | + CONTENT " |
| 12 | + #define COMPILED_WITH_SWIFT |
| 13 | + #define SWIFT_TARGET |
13 | 14 |
|
14 |
| -#include \"swift/Basic/BasicBridging.h\" |
15 |
| -#include \"swift/AST/ASTBridging.h\" |
16 |
| -#include \"swift/IDE/IDEBridging.h\" |
17 |
| -#include \"swift/Parse/ParseBridging.h\" |
18 |
| -#include \"swift/SIL/SILBridging.h\" |
19 |
| -#include \"swift/SILOptimizer/OptimizerBridging.h\" |
20 |
| -") |
21 |
| -add_library(importedHeaderDependencies "${CMAKE_CURRENT_BINARY_DIR}/HeaderDependencies.cpp") |
| 15 | + #include \"swift/Basic/BasicBridging.h\" |
| 16 | + #include \"swift/AST/ASTBridging.h\" |
| 17 | + #include \"swift/IDE/IDEBridging.h\" |
| 18 | + #include \"swift/Parse/ParseBridging.h\" |
| 19 | + #include \"swift/SIL/SILBridging.h\" |
| 20 | + #include \"swift/SILOptimizer/OptimizerBridging.h\" |
| 21 | + ") |
| 22 | + add_library(importedHeaderDependencies "${CMAKE_CURRENT_BINARY_DIR}/HeaderDependencies.cpp") |
22 | 23 |
|
23 |
| -# When building unified, we need to make sure all the Clang headers are |
24 |
| -# generated before we try to use them. |
25 |
| -# When building Swift against an already compiled LLVM/Clang, like |
26 |
| -# build-script does, this target does not exist, but the headers |
27 |
| -# are already completely generated at that point. |
28 |
| -if(TARGET clang-tablegen-targets) |
29 |
| - add_dependencies(importedHeaderDependencies clang-tablegen-targets) |
| 24 | + # When building unified, we need to make sure all the Clang headers are |
| 25 | + # generated before we try to use them. |
| 26 | + # When building Swift against an already compiled LLVM/Clang, like |
| 27 | + # build-script does, this target does not exist, but the headers |
| 28 | + # are already completely generated at that point. |
| 29 | + if(TARGET clang-tablegen-targets) |
| 30 | + add_dependencies(importedHeaderDependencies clang-tablegen-targets) |
| 31 | + endif() |
30 | 32 | endif()
|
0 commit comments