Skip to content

Commit 9a101b7

Browse files
authored
Merge pull request #2289 from rintaro/5.9-cmake-abi-name-rdar116951101
[5.9][CMake] Add option to specify '-module-abi-name'
2 parents d3fe9e7 + 3ede5a0 commit 9a101b7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cmake/modules/AddSwiftHostLibrary.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,15 @@ function(add_swift_host_library name)
5454
-emit-module-path;${module_file};
5555
-emit-module-source-info-path;${module_sourceinfo_file};
5656
-emit-module-interface-path;${module_interface_file}
57+
>)
58+
if(SWIFT_MODULE_ABI_NAME_PREFIX)
59+
# ABI name prefix. this can be used to avoid name conflicts.
60+
target_compile_options("${name}" PRIVATE
61+
$<$<COMPILE_LANGUAGE:Swift>:
62+
"SHELL:-Xfrontend -module-abi-name"
63+
"SHELL:-Xfrontend ${SWIFT_MODULE_ABI_NAME_PREFIX}${name}"
5764
>)
65+
endif()
5866

5967
# NOTE: workaround for CMake not setting up include flags yet
6068
set_target_properties(${name} PROPERTIES

0 commit comments

Comments
 (0)