From a1c47f33012d17038b80ffb867f5cb2e7f0a5548 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Mon, 30 Aug 2021 15:30:56 -0700 Subject: [PATCH] build: repair the build of ArgumentParser with CMake The changes in #335 introduced a new library but failed to actually build the library and update the dependency structure. Update the build system to build and install the new target. --- Sources/ArgumentParser/CMakeLists.txt | 3 ++- Sources/ArgumentParserToolInfo/CMakeLists.txt | 11 +++++++++++ Sources/CMakeLists.txt | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 Sources/ArgumentParserToolInfo/CMakeLists.txt diff --git a/Sources/ArgumentParser/CMakeLists.txt b/Sources/ArgumentParser/CMakeLists.txt index 18cb753e8..84b726d36 100644 --- a/Sources/ArgumentParser/CMakeLists.txt +++ b/Sources/ArgumentParser/CMakeLists.txt @@ -47,7 +47,8 @@ set_target_properties(ArgumentParser PROPERTIES target_compile_options(ArgumentParser PRIVATE $<$:-enable-testing>) target_link_libraries(ArgumentParser PRIVATE - $<$>:Foundation>) + $<$>:Foundation> + ArgumentParserToolInfo) _install_target(ArgumentParser) diff --git a/Sources/ArgumentParserToolInfo/CMakeLists.txt b/Sources/ArgumentParserToolInfo/CMakeLists.txt new file mode 100644 index 000000000..e3a6c23ea --- /dev/null +++ b/Sources/ArgumentParserToolInfo/CMakeLists.txt @@ -0,0 +1,11 @@ +add_library(ArgumentParserToolInfo + ToolInfo.swift) +# NOTE: workaround for CMake not setting up include flags yet +set_target_properties(ArgumentParserToolInfo PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY}) +target_compile_options(ArgumentParserToolInfo PRIVATE + $<$:-enable-testing>) + + +_install_target(ArgumentParserToolInfo) +set_property(GLOBAL APPEND PROPERTY ArgumentParser_EXPORTS ArgumentParserToolInfo) diff --git a/Sources/CMakeLists.txt b/Sources/CMakeLists.txt index a98ace356..b1772e671 100644 --- a/Sources/CMakeLists.txt +++ b/Sources/CMakeLists.txt @@ -1,4 +1,5 @@ add_subdirectory(ArgumentParser) +add_subdirectory(ArgumentParserToolInfo) if(BUILD_TESTING) add_subdirectory(ArgumentParserTestHelpers) endif()