Skip to content

Commit 1cb85e5

Browse files
committed
[SwiftCompilerSources] Add SwiftShims to the include paths
This allows Swift to import C++ headers from `include/swift` that include SwiftShims headers. Previously that would result in a build error.
1 parent df22aeb commit 1cb85e5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

SwiftCompilerSources/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,11 @@ function(add_swift_compiler_modules_library name)
126126
get_versioned_target_triple(target ${SWIFT_HOST_VARIANT_SDK}
127127
${SWIFT_HOST_VARIANT_ARCH} "${deployment_version}")
128128

129+
# Let Swift discover SwiftShims headers which are included by some headers
130+
# under `include/swift`.
131+
get_filename_component(swift_exec_bin_dir ${ALS_SWIFT_EXEC} DIRECTORY)
132+
set(sdk_option ${sdk_option} "-I" "${swift_exec_bin_dir}/../lib")
133+
129134
set(all_obj_files)
130135
set(all_module_targets)
131136
set(syntaxparse_obj_files)

0 commit comments

Comments
 (0)