Skip to content

Commit

Permalink
Moves GenerateXCTestMain CMake support to Sources/CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
dabrahams committed Mar 5, 2024
1 parent b3586a7 commit 9bb75f1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
16 changes: 1 addition & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,7 @@ if (PROJECT_IS_TOP_LEVEL)
endif()

if(NOT APPLE OR SwiftCMakeXCTesting_FORCE_BUILD_GenerateXCTestMain)
find_package(ArgumentParser REQUIRED)
find_package(SwiftSyntax REQUIRED)

add_executable(GenerateXCTestMain Sources/GenerateXCTestMain.swift)
target_link_libraries(GenerateXCTestMain
ArgumentParser
SwiftSyntax
SwiftSyntaxBuilder
SwiftOperators
SwiftParser
SwiftParserDiagnostics
)

# Needed where @main is used.
target_compile_options(GenerateXCTestMain PRIVATE -parse-as-library)
add_subdirectory(Sources)
endif()

if(ENABLE_TESTING)
Expand Down
15 changes: 15 additions & 0 deletions Sources/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
find_package(ArgumentParser REQUIRED)
find_package(SwiftSyntax REQUIRED)

add_executable(GenerateXCTestMain GenerateXCTestMain.swift)
target_link_libraries(GenerateXCTestMain
ArgumentParser
SwiftSyntax
SwiftSyntaxBuilder
SwiftOperators
SwiftParser
SwiftParserDiagnostics
)

# Needed where @main is used.
target_compile_options(GenerateXCTestMain PRIVATE -parse-as-library)

0 comments on commit 9bb75f1

Please sign in to comment.