mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
As of CMake 3.25, there are now global variables `LINUX=1`, `ANDROID=1`,
etc. These conflict with expressions that used these names as unquoted
strings in positions where CMake accepts 'variable|string', for example:
- `if(sdk STREQUAL LINUX)` would fail, because `LINUX` is now defined and
expands to 1, where it would previously coerce to a string.
- `if(${sdk} STREQUAL "LINUX")` would fail if `sdk=LINUX`, because the
left-hand side expands twice.
In this patch, I looked for a number of patterns to fix up, sometimes a
little defensively:
- Quoted right-hand side of `STREQUAL` where I was confident it was
intended to be a string literal.
- Removed manual variable expansion on left-hand side of `STREQUAL`,
`MATCHES` and `IN_LIST` where I was confident it was unintended.
Fixes #65028.
17 lines
392 B
CMake
17 lines
392 B
CMake
add_sourcekit_library(SourceKitSupport
|
|
Concurrency-libdispatch.cpp
|
|
Logging.cpp
|
|
ImmutableTextBuffer.cpp
|
|
ThreadSafeRefCntPtr.cpp
|
|
Tracing.cpp
|
|
UIDRegistry.cpp)
|
|
target_link_libraries(SourceKitSupport PRIVATE
|
|
swiftBasic
|
|
clangBasic
|
|
clangRewrite)
|
|
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
|
target_link_libraries(SourceKitSupport INTERFACE
|
|
dispatch
|
|
BlocksRuntime)
|
|
endif()
|