Skip to content

Commit ad2dacd

Browse files
committed
[CMake] Handle cases where Swift parser integration is disabled in Linux
When Swift parser integration is disabled (i.e. NOT SWIFT_SWIFT_PARSER), macro plugins targets are not created. So CMake should bail out.
1 parent 2b6b3fd commit ad2dacd

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/Macros/CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ function(add_swift_macro_library name)
3131
# Add the library.
3232
add_pure_swift_host_library(${name} SHARED ${ASML_SOURCES})
3333

34+
# If we don't have the Swift swift parser, bail out, because the above
35+
# add_pure_swift_host_library did nothing.
36+
if (NOT SWIFT_SWIFT_PARSER)
37+
return()
38+
endif()
39+
3440
# Add rpath to 'lib/{platform}'
3541
file(RELATIVE_PATH relpath_to_lib
3642
"${SWIFT_HOST_PLUGINS_DEST_DIR}"
@@ -44,12 +50,6 @@ function(add_swift_macro_library name)
4450
APPEND PROPERTY INSTALL_RPATH "$ORIGIN/..")
4551
endif()
4652

47-
# If we don't have the Swift swift parser, bail out, because the above
48-
# add_pure_swift_host_library did nothing.
49-
if (NOT SWIFT_SWIFT_PARSER)
50-
return()
51-
endif()
52-
5353
# Install into the plugin directory.
5454
set_target_properties(${name}
5555
PROPERTIES

0 commit comments

Comments
 (0)