Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 2 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,29 +1,11 @@
cmake_minimum_required(VERSION 3.24)

cmake_minimum_required(VERSION 3.29)

# set_property(GLOBAL PROPERTY GLOBAL_DEPENDS_DEBUG_MODE 1)

# TODO: Fix RPATH usage to be CMP0068 compliant
# Disable Policy CMP0068 for CMake 3.9
# rdar://37725888
if(POLICY CMP0068)
cmake_policy(SET CMP0068 OLD)
endif()

# Honour CMAKE_CXX_STANDARD in try_compile(), needed for check_cxx_native_regex.
if(POLICY CMP0067)
cmake_policy(SET CMP0067 NEW)
endif()

# Convert relative paths to absolute for subdirectory `target_sources`
if(POLICY CMP0076)
cmake_policy(SET CMP0076 NEW)
endif()

# Don't clobber existing variable values when evaluating `option()` declarations.
if(POLICY CMP0077)
cmake_policy(SET CMP0077 NEW)
endif()
cmake_policy(SET CMP0068 OLD)

# Add path for custom CMake modules.
list(APPEND CMAKE_MODULE_PATH
Expand Down
28 changes: 0 additions & 28 deletions cmake/modules/AddPureSwift.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -371,15 +371,6 @@ function(add_pure_swift_host_library name)
# NOTE: workaround for CMake not setting up include flags.
INTERFACE_INCLUDE_DIRECTORIES ${module_dir})

# Workaround to touch the library and its objects so that we don't
# continually rebuild (again, see corresponding change in swift-syntax).
add_custom_command(
TARGET ${name}
POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E touch_nocreate $<TARGET_FILE:${name}> $<TARGET_OBJECTS:${name}> "${module_file}"
COMMAND_EXPAND_LISTS
COMMENT "Update mtime of library outputs workaround")

# Downstream linking should include the swiftmodule in debug builds to allow lldb to
# work correctly. Only do this on Darwin since neither gold (currently used by default
# on Linux), nor the default Windows linker 'link' support '-add_ast_path'.
Expand Down Expand Up @@ -517,25 +508,6 @@ function(add_pure_swift_host_tool name)
"SHELL:-Xlinker --build-id=sha1")
endif()

# Workaround to touch the library and its objects so that we don't
# continually rebuild (again, see corresponding change in swift-syntax).
add_custom_command(
TARGET ${name}
POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E touch_nocreate $<TARGET_FILE:${name}> $<TARGET_OBJECTS:${name}>
COMMAND_EXPAND_LISTS
COMMENT "Update mtime of executable outputs workaround")

# Even worse hack - ${name}.swiftmodule is added as an output, even though
# this is an executable target. Just touch it all the time to avoid having
# to rebuild it every time.
add_custom_command(
TARGET ${name}
POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E touch "${CMAKE_CURRENT_BINARY_DIR}/${name}.swiftmodule"
COMMAND_EXPAND_LISTS
COMMENT "Update mtime of executable outputs workaround")

if(NOT APSHT_SWIFT_COMPONENT STREQUAL no_component)
add_dependencies(${APSHT_SWIFT_COMPONENT} ${name})
swift_install_in_component(TARGETS ${name}
Expand Down
3 changes: 3 additions & 0 deletions lib/ASTGen/Sources/SwiftIDEUtilsBridging/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ add_pure_swift_host_library(swiftIDEUtilsBridging CXX_INTEROP
DEPENDENCIES
swiftAST
SWIFT_DEPENDENCIES
_CompilerSwiftBasicFormat
_CompilerSwiftIDEUtils
_CompilerSwiftSyntax
_CompilerSwiftIDEUtils
_CompilerSwiftSyntaxMacroExpansion
_CompilerSwiftSyntaxMacros
swiftASTGen
)
1 change: 1 addition & 0 deletions lib/Macros/Sources/ObservationMacros/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ add_swift_macro_library(ObservationMacros
SwiftSyntaxBuilder
SwiftSyntax
SwiftSyntaxMacros
SwiftOperators
)
1 change: 1 addition & 0 deletions lib/Macros/Sources/SwiftMacros/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ add_swift_macro_library(SwiftMacros
SwiftSyntax
SwiftSyntaxBuilder
SwiftSyntaxMacros
SwiftOperators
)
6 changes: 6 additions & 0 deletions tools/swift-function-caller-generator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ if (SWIFT_BUILD_SWIFT_SYNTAX)
SwiftSyntax
SwiftSyntaxBuilder
SwiftSyntaxMacros
SwiftDiagnostics
SwiftOperators
PACKAGE_NAME Toolchain
)

set_target_properties(swift-function-caller-generator PROPERTIES
Swift_MODULE_NAME SwiftFunctionCallerGenerator
)
endif()
5 changes: 5 additions & 0 deletions tools/swift-plugin-server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ if (SWIFT_BUILD_SWIFT_SYNTAX)
SWIFT_DEPENDENCIES
SwiftCompilerPluginMessageHandling
SwiftLibraryPluginProvider
SwiftSyntaxBuilder
PACKAGE_NAME Toolchain
)
set_target_properties(swift-plugin-server PROPERTIES
Swift_MODULE_NAME SwiftPluginServer
)

set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${SWIFT_HOST_LIBRARIES_DEST_DIR}")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${SWIFT_HOST_LIBRARIES_DEST_DIR}")
Expand All @@ -16,6 +20,7 @@ if (SWIFT_BUILD_SWIFT_SYNTAX)
SWIFT_DEPENDENCIES
SwiftCompilerPluginMessageHandling
SwiftLibraryPluginProvider
SwiftSyntaxBuilder
PACKAGE_NAME Toolchain
)

Expand Down