Skip to content

Commit 2b45eb9

Browse files
committed
SourceKit: simplify and modernise CMake for tests
Use `target_compile_definitions` to fix the quoting. This is particularly important when running under a non-sh shell (e.g. Windows) where the quoting rules are different.
1 parent 870dae5 commit 2b45eb9

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed
Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
11
if(NOT SWIFT_HOST_VARIANT MATCHES "${SWIFT_DARWIN_EMBEDDED_VARIANTS}")
2-
32
add_swift_unittest(SourceKitSwiftLangTests
43
CursorInfoTest.cpp
54
EditingTest.cpp
65
)
7-
8-
target_link_libraries(SourceKitSwiftLangTests
9-
PRIVATE
10-
SourceKitSwiftLang
11-
)
12-
13-
set_property(TARGET SourceKitSwiftLangTests APPEND_STRING PROPERTY COMPILE_FLAGS
14-
" '-DSWIFTLIB_DIR=\"${SWIFTLIB_DIR}\"'")
15-
6+
target_link_libraries(SourceKitSwiftLangTests PRIVATE SourceKitSwiftLang)
7+
target_compile_definitions(SourceKitSwiftLangTests PRIVATE
8+
SWIFTLIB_DIR=\"${SWIFTLIB_DIR}\")
169
endif()

0 commit comments

Comments
 (0)