Skip to content

[cmake] Remove remaining XCODE checks #82118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 10, 2025
Merged
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
31 changes: 1 addition & 30 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -874,12 +874,7 @@ include(CMakePushCheckState)

# Print out path and version of any installed commands
message(STATUS "CMake (${CMAKE_COMMAND}) Version: ${CMAKE_VERSION}")
if(XCODE)
set(version_flag -version)
else()
set(version_flag --version)
endif()
execute_process(COMMAND ${CMAKE_MAKE_PROGRAM} ${version_flag}
execute_process(COMMAND ${CMAKE_MAKE_PROGRAM} --version
OUTPUT_VARIABLE _CMAKE_MAKE_PROGRAM_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
message(STATUS "CMake Make Program (${CMAKE_MAKE_PROGRAM}) Version: ${_CMAKE_MAKE_PROGRAM_VERSION}")
Expand Down Expand Up @@ -1147,14 +1142,6 @@ endif()
# Configure SDKs.
#

if(XCODE)
# FIXME: It used to be the case that Xcode would force
# -m${platform}-version-min flags that would conflict with those computed
# by build-script. version-min flags are deprecated in favor of -target since
# clang-11, so we might be able to undo this.
set(SWIFT_SDKS "OSX")
endif()

# FIXME: the parameters we specify in SWIFT_SDKS are lacking architecture specifics,
# so we need to hard-code it. For example, the SDK for Android is just 'ANDROID',
# and we have to specify SWIFT_SDK_ANDROID_ARCHITECTURES separately.
Expand Down Expand Up @@ -1597,22 +1584,6 @@ swift_install_in_component(FILES "LICENSE.txt"
DESTINATION "share/swift"
COMPONENT license)

# Add a documentation target so that documentation shows up in the
# Xcode project.
if(XCODE)
add_custom_target(Documentation
SOURCES
README.md
docs)

file(GLOB SWIFT_TOPLEVEL_HEADERS
${CMAKE_CURRENT_SOURCE_DIR}/include/swift${dir}/*.h
${CMAKE_CURRENT_SOURCE_DIR}/include/swift${dir}/*.td
${CMAKE_CURRENT_SOURCE_DIR}/include/swift${dir}/*.def)
add_custom_target(Miscellaneous
SOURCES ${SWIFT_TOPLEVEL_HEADERS})
endif()

# New standard library build
option(SWIFT_ENABLE_NEW_RUNTIME_BUILD "Build Swift runtimes with new build system" OFF)
if(SWIFT_ENABLE_NEW_RUNTIME_BUILD)
Expand Down
6 changes: 0 additions & 6 deletions SwiftCompilerSources/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -279,12 +279,6 @@ function(add_swift_compiler_modules_library name)
endforeach()

# Create a static library containing all module object files.
if (XCODE)
# Xcode does not compile libraries that contain only object files.
# Therefore, it fails to create the static library. As a workaround,
# we add an empty source file force_lib.c to the target.
set(all_obj_files force_lib.c ${all_obj_files})
endif()
add_library(${name} STATIC ${all_obj_files})
add_dependencies(${name} ${all_module_targets})
set_target_properties(${name} PROPERTIES LINKER_LANGUAGE CXX)
Expand Down
16 changes: 1 addition & 15 deletions lib/RemoteAST/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
if(XCODE)
file(GLOB_RECURSE REMOTE_LIB_HEADERS
${SWIFT_SOURCE_DIR}/include/swift/Remote/*.h
${SWIFT_SOURCE_DIR}/include/swift/Remote/*.def)

set_source_files_properties(${REMOTE_LIB_HEADERS}
PROPERTIES
HEADER_FILE_ONLY true)
source_group("libRemote Headers" FILES ${REMOTE_LIB_HEADERS})
else()
set(REMOTE_LIB_HEADERS)
endif()

add_swift_host_library(swiftRemoteAST STATIC
RemoteAST.cpp
InProcessMemoryReader.cpp
${REMOTE_LIB_HEADERS})
InProcessMemoryReader.cpp)
target_link_libraries(swiftRemoteAST PUBLIC
swiftDemangling)
target_link_libraries(swiftRemoteAST PRIVATE
Expand Down
6 changes: 1 addition & 5 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ function(swift_configure_lit_site_cfg source_path destination_path installed_nam
string(REPLACE ${CMAKE_CFG_INTDIR} ${SWIFT_BUILD_MODE} LLVM_TOOLS_DIR ${LLVM_TOOLS_BINARY_DIR})
string(REPLACE ${CMAKE_CFG_INTDIR} ${SWIFT_BUILD_MODE} LLVM_LIBS_DIR ${LLVM_LIBRARY_DIR})

if (XCODE)
string(REPLACE ${CMAKE_CFG_INTDIR} Debug LIT_SWIFTLIB_DIR ${SWIFTLIB_DIR})
else ()
set(LIT_SWIFTLIB_DIR ${SWIFTLIB_DIR})
endif ()
set(LIT_SWIFTLIB_DIR ${SWIFTLIB_DIR})

configure_file("${source_path}" "${destination_path}" @ONLY)

Expand Down
10 changes: 0 additions & 10 deletions tools/SourceKit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,6 @@ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
else()
message(FATAL_ERROR "Can't understand SOURCEKIT_DEPLOYMENT_OS '${SOURCEKIT_DEPLOYMENT_OS}';")
endif()

# Add deployment target to C/C++ compiler and linker flags.
# FIXME: CMAKE_OSX_DEPLOYMENT_TARGET falls over when used for iOS versions.
if (XCODE)
if (SOURCEKIT_DEPLOYMENT_OS MATCHES "^macosx")
set(CMAKE_XCODE_ATTRIBUTE_MACOSX_DEPLOYMENT_TARGET ${SOURCEKIT_DEPLOYMENT_TARGET})
else()
set(CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET ${SOURCEKIT_DEPLOYMENT_TARGET})
endif()
endif()
endif()

include_directories(BEFORE
Expand Down