Files
swift-mirror/tools/swift-syntax-parser-test/CMakeLists.txt
Saleem Abdulrasool 218b37e1bb build: rename LLVM_COMPONENT_DEPENDS
This is not a target dependency but a target link.  Name the parameter
to be less misleading.  This also makes the name identical to the LLVM
parameter.
2019-05-04 19:58:28 -07:00

30 lines
953 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 tools
)
target_link_libraries(swift-syntax-parser-test
PRIVATE
libSwiftSyntaxParser
)
if(APPLE)
# Prioritize finding the parser library from the build/lib directory.
# Otherwise it may find it from the 'lib/swift/macosx' directory which could
# be out-of-date.
get_target_property(link_flags swift-syntax-parser-test LINK_FLAGS)
set(link_flags "-Xlinker -rpath -Xlinker @executable_path/../lib ${link_flags}")
set_property(TARGET swift-syntax-parser-test PROPERTY
LINK_FLAGS "${link_flags}")
endif()
set_property(TARGET swift-syntax-parser-test APPEND_STRING PROPERTY
COMPILE_FLAGS " -fblocks")
if(SWIFT_NEED_EXPLICIT_LIBDISPATCH)
target_link_libraries(swift-syntax-parser-test PRIVATE BlocksRuntime)
endif()