Skip to content

Commit

Permalink
build: repair the build of ArgumentParser with CMake
Browse files Browse the repository at this point in the history
The changes in apple#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.
  • Loading branch information
compnerd committed Aug 30, 2021
1 parent b3bef58 commit a1c47f3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Sources/ArgumentParser/CMakeLists.txt
Expand Up @@ -47,7 +47,8 @@ set_target_properties(ArgumentParser PROPERTIES
target_compile_options(ArgumentParser PRIVATE
$<$<BOOL:${BUILD_TESTING}>:-enable-testing>)
target_link_libraries(ArgumentParser PRIVATE
$<$<NOT:$<PLATFORM_ID:Darwin>>:Foundation>)
$<$<NOT:$<PLATFORM_ID:Darwin>>:Foundation>
ArgumentParserToolInfo)


_install_target(ArgumentParser)
Expand Down
11 changes: 11 additions & 0 deletions 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
$<$<BOOL:${BUILD_TESTING}>:-enable-testing>)


_install_target(ArgumentParserToolInfo)
set_property(GLOBAL APPEND PROPERTY ArgumentParser_EXPORTS ArgumentParserToolInfo)
1 change: 1 addition & 0 deletions Sources/CMakeLists.txt
@@ -1,4 +1,5 @@
add_subdirectory(ArgumentParser)
add_subdirectory(ArgumentParserToolInfo)
if(BUILD_TESTING)
add_subdirectory(ArgumentParserTestHelpers)
endif()

0 comments on commit a1c47f3

Please sign in to comment.