From 0923343acf19cf1658d49f1782ba7f157250d71c Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Mon, 26 Aug 2024 21:35:45 -0600 Subject: [PATCH] [CMake] Fix build with SwiftTesting_BuildMacrosAsExecutables option set There were two issues: - typo -load-plugin-exectuable -> -load-plugin-executable - The executable target for TestingMacros was not installed Resolves https://github.com/swiftlang/swift-testing/issues/644 --- Sources/CMakeLists.txt | 2 +- Sources/TestingMacros/CMakeLists.txt | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Sources/CMakeLists.txt b/Sources/CMakeLists.txt index 6b55259bf..83a9a2b23 100644 --- a/Sources/CMakeLists.txt +++ b/Sources/CMakeLists.txt @@ -97,7 +97,7 @@ elseif(SwiftTesting_MACRO_PATH) add_compile_options("$<$:SHELL:-load-plugin-library ${SwiftTesting_MACRO_PATH}>") else() message(STATUS "TestingMacros: ${SwiftTesting_MACRO_PATH} (executable)") - add_compile_options("$<$:SHELL:-load-plugin-exectuable ${SwiftTesting_MACRO_PATH}#TestingMacros>") + add_compile_options("$<$:SHELL:-load-plugin-executable ${SwiftTesting_MACRO_PATH}#TestingMacros>") endif() endif() diff --git a/Sources/TestingMacros/CMakeLists.txt b/Sources/TestingMacros/CMakeLists.txt index d8fab3c2f..a45663025 100644 --- a/Sources/TestingMacros/CMakeLists.txt +++ b/Sources/TestingMacros/CMakeLists.txt @@ -56,6 +56,9 @@ if(SwiftTesting_BuildMacrosAsExecutables) # Include the .swift file which contains its `@main` entry point type. target_compile_definitions(TestingMacros PRIVATE SWT_NO_LIBRARY_MACRO_PLUGINS) + + install(TARGETS TestingMacros + RUNTIME DESTINATION bin) else() add_library(TestingMacros SHARED)