Files
swift-mirror/tools/swift-syntax-parser-test/CMakeLists.txt
Michael Gottesman 06cb5c0047 [cmake] Move a bunch of test binaries from install component 'tools' -> 'testsuite-tools'.
All of these are tools that are only meant to be used when testing swift. Thus
it doesn't make sense to include them in the catch all 'tools' install component
that distributions use to build all the tools.

I verified that all of the mac/linux presets in tree that have tools also has
testsuite-tools so this should be NFC. On Windows, I needed to add
testsuite-tools to build-windows.bat so should be NFC there as well.
2021-11-09 12:51:58 -08:00

27 lines
899 B
CMake

include(SwiftWindowsSupport)
swift_swap_compiler_if_needed("SwiftSyntaxParserTest")
add_swift_host_tool(swift-syntax-parser-test
swift-syntax-parser-test.cpp
LLVM_LINK_COMPONENTS
support
SWIFT_COMPONENT testsuite-tools
)
if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
set_target_properties(swift-syntax-parser-test PROPERTIES
BUILD_WITH_INSTALL_RPATH YES
INSTALL_RPATH @executable_path/../lib)
elseif(NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
set_target_properties(swift-syntax-parser-test PROPERTIES
INSTALL_RPATH ${SWIFT_LIBRARY_OUTPUT_INTDIR})
endif()
target_compile_options(swift-syntax-parser-test PRIVATE
-fblocks)
target_link_libraries(swift-syntax-parser-test PRIVATE
$<$<NOT:$<PLATFORM_ID:Darwin>>:BlocksRuntime>
libSwiftSyntaxParser)
if(NOT SWIFT_BUILT_STANDALONE AND NOT CMAKE_C_COMPILER_ID MATCHES Clang)
add_dependencies(swift-syntax-parser-test clang)
endif()