File tree Expand file tree Collapse file tree 4 files changed +21
-8
lines changed
tools/SourceKit/tools/sourcekitd-test Expand file tree Collapse file tree 4 files changed +21
-8
lines changed Original file line number Diff line number Diff line change
1
+ include (TableGen )
2
+
3
+ # This needs to be a macro since tablegen (which is a function) needs to set
4
+ # variables in its parent scope.
5
+ macro (swift_tablegen )
6
+ tablegen (SWIFT ${ARGN} )
7
+ endmacro ()
8
+
9
+ # This needs to be a macro since add_public_tablegen_target (which is a
10
+ # function) needs to set variables in its parent scope.
11
+ macro (swift_add_public_tablegen_target target )
12
+ add_public_tablegen_target (${target} )
13
+ endmacro ()
Original file line number Diff line number Diff line change @@ -107,19 +107,19 @@ macro(swift_common_standalone_build_config product is_cross_compiling)
107
107
endif ()
108
108
109
109
if (${is_cross_compiling} )
110
- find_program (LLVM_TABLEGEN_EXE "llvm-tblgen" "${${product} _NATIVE_LLVM_TOOLS_PATH}"
110
+ find_program (SWIFT_TABLEGEN_EXE "llvm-tblgen" "${${product} _NATIVE_LLVM_TOOLS_PATH}"
111
111
NO_DEFAULT_PATH )
112
- if ("${LLVM_TABLEGEN_EXE } " STREQUAL "LLVM_TABLEGEN_EXE -NOTFOUND" )
112
+ if ("${SWIFT_TABLEGEN_EXE } " STREQUAL "SWIFT_TABLEGEN_EXE -NOTFOUND" )
113
113
message (FATAL_ERROR "Failed to find tablegen in ${${product} _NATIVE_LLVM_TOOLS_PATH}" )
114
114
endif ()
115
115
else ()
116
- set (LLVM_TABLEGEN_EXE llvm-tblgen )
116
+ set (SWIFT_TABLEGEN_EXE llvm-tblgen )
117
117
set (${product} _NATIVE_LLVM_TOOLS_PATH "${PATH_TO_LLVM_TOOLS_BINARY_DIR} " )
118
118
set (${product} _NATIVE_CLANG_TOOLS_PATH "${PATH_TO_LLVM_TOOLS_BINARY_DIR} " )
119
119
endif ()
120
120
121
121
include (AddLLVM )
122
- include (TableGen )
122
+ include (AddSwiftTableGen ) # This imports TableGen from LLVM.
123
123
include (HandleLLVMOptions )
124
124
125
125
set (PACKAGE_VERSION "${LLVM_PACKAGE_VERSION} " )
Original file line number Diff line number Diff line change 1
1
set (LLVM_TARGET_DEFINITIONS Options .td )
2
- tablegen ( LLVM Options .inc -gen-opt-parser-defs )
3
- add_public_tablegen_target (SwiftOptions )
2
+ swift_tablegen ( Options .inc -gen-opt-parser-defs )
3
+ swift_add_public_tablegen_target (SwiftOptions )
Original file line number Diff line number Diff line change 1
1
set (LLVM_TARGET_DEFINITIONS Options .td )
2
- tablegen ( LLVM Options .inc -gen-opt-parser-defs )
3
- add_public_tablegen_target (sourcekitdTestOptionsTableGen )
2
+ swift_tablegen ( Options .inc -gen-opt-parser-defs )
3
+ swift_add_public_tablegen_target (sourcekitdTestOptionsTableGen )
4
4
5
5
if (SWIFT_SOURCEKIT_USE_INPROC_LIBRARY )
6
6
set (SOURCEKITD_TEST_DEPEND sourcekitdInProc )
You can’t perform that action at this time.
0 commit comments