Skip to content

Commit 4b2af07

Browse files
authored
Merge pull request #82118 from hamishknight/excode
[cmake] Remove remaining `XCODE` checks
2 parents 48ebd52 + 8f4fbe3 commit 4b2af07

File tree

5 files changed

+3
-66
lines changed

5 files changed

+3
-66
lines changed

CMakeLists.txt

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -874,12 +874,7 @@ include(CMakePushCheckState)
874874

875875
# Print out path and version of any installed commands
876876
message(STATUS "CMake (${CMAKE_COMMAND}) Version: ${CMAKE_VERSION}")
877-
if(XCODE)
878-
set(version_flag -version)
879-
else()
880-
set(version_flag --version)
881-
endif()
882-
execute_process(COMMAND ${CMAKE_MAKE_PROGRAM} ${version_flag}
877+
execute_process(COMMAND ${CMAKE_MAKE_PROGRAM} --version
883878
OUTPUT_VARIABLE _CMAKE_MAKE_PROGRAM_VERSION
884879
OUTPUT_STRIP_TRAILING_WHITESPACE)
885880
message(STATUS "CMake Make Program (${CMAKE_MAKE_PROGRAM}) Version: ${_CMAKE_MAKE_PROGRAM_VERSION}")
@@ -1147,14 +1142,6 @@ endif()
11471142
# Configure SDKs.
11481143
#
11491144

1150-
if(XCODE)
1151-
# FIXME: It used to be the case that Xcode would force
1152-
# -m${platform}-version-min flags that would conflict with those computed
1153-
# by build-script. version-min flags are deprecated in favor of -target since
1154-
# clang-11, so we might be able to undo this.
1155-
set(SWIFT_SDKS "OSX")
1156-
endif()
1157-
11581145
# FIXME: the parameters we specify in SWIFT_SDKS are lacking architecture specifics,
11591146
# so we need to hard-code it. For example, the SDK for Android is just 'ANDROID',
11601147
# and we have to specify SWIFT_SDK_ANDROID_ARCHITECTURES separately.
@@ -1597,22 +1584,6 @@ swift_install_in_component(FILES "LICENSE.txt"
15971584
DESTINATION "share/swift"
15981585
COMPONENT license)
15991586

1600-
# Add a documentation target so that documentation shows up in the
1601-
# Xcode project.
1602-
if(XCODE)
1603-
add_custom_target(Documentation
1604-
SOURCES
1605-
README.md
1606-
docs)
1607-
1608-
file(GLOB SWIFT_TOPLEVEL_HEADERS
1609-
${CMAKE_CURRENT_SOURCE_DIR}/include/swift${dir}/*.h
1610-
${CMAKE_CURRENT_SOURCE_DIR}/include/swift${dir}/*.td
1611-
${CMAKE_CURRENT_SOURCE_DIR}/include/swift${dir}/*.def)
1612-
add_custom_target(Miscellaneous
1613-
SOURCES ${SWIFT_TOPLEVEL_HEADERS})
1614-
endif()
1615-
16161587
# New standard library build
16171588
option(SWIFT_ENABLE_NEW_RUNTIME_BUILD "Build Swift runtimes with new build system" OFF)
16181589
if(SWIFT_ENABLE_NEW_RUNTIME_BUILD)

SwiftCompilerSources/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -279,12 +279,6 @@ function(add_swift_compiler_modules_library name)
279279
endforeach()
280280

281281
# Create a static library containing all module object files.
282-
if (XCODE)
283-
# Xcode does not compile libraries that contain only object files.
284-
# Therefore, it fails to create the static library. As a workaround,
285-
# we add an empty source file force_lib.c to the target.
286-
set(all_obj_files force_lib.c ${all_obj_files})
287-
endif()
288282
add_library(${name} STATIC ${all_obj_files})
289283
add_dependencies(${name} ${all_module_targets})
290284
set_target_properties(${name} PROPERTIES LINKER_LANGUAGE CXX)

lib/RemoteAST/CMakeLists.txt

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,6 @@
1-
if(XCODE)
2-
file(GLOB_RECURSE REMOTE_LIB_HEADERS
3-
${SWIFT_SOURCE_DIR}/include/swift/Remote/*.h
4-
${SWIFT_SOURCE_DIR}/include/swift/Remote/*.def)
5-
6-
set_source_files_properties(${REMOTE_LIB_HEADERS}
7-
PROPERTIES
8-
HEADER_FILE_ONLY true)
9-
source_group("libRemote Headers" FILES ${REMOTE_LIB_HEADERS})
10-
else()
11-
set(REMOTE_LIB_HEADERS)
12-
endif()
13-
141
add_swift_host_library(swiftRemoteAST STATIC
152
RemoteAST.cpp
16-
InProcessMemoryReader.cpp
17-
${REMOTE_LIB_HEADERS})
3+
InProcessMemoryReader.cpp)
184
target_link_libraries(swiftRemoteAST PUBLIC
195
swiftDemangling)
206
target_link_libraries(swiftRemoteAST PRIVATE

test/CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,7 @@ function(swift_configure_lit_site_cfg source_path destination_path installed_nam
1212
string(REPLACE ${CMAKE_CFG_INTDIR} ${SWIFT_BUILD_MODE} LLVM_TOOLS_DIR ${LLVM_TOOLS_BINARY_DIR})
1313
string(REPLACE ${CMAKE_CFG_INTDIR} ${SWIFT_BUILD_MODE} LLVM_LIBS_DIR ${LLVM_LIBRARY_DIR})
1414

15-
if (XCODE)
16-
string(REPLACE ${CMAKE_CFG_INTDIR} Debug LIT_SWIFTLIB_DIR ${SWIFTLIB_DIR})
17-
else ()
18-
set(LIT_SWIFTLIB_DIR ${SWIFTLIB_DIR})
19-
endif ()
15+
set(LIT_SWIFTLIB_DIR ${SWIFTLIB_DIR})
2016

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

tools/SourceKit/CMakeLists.txt

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,6 @@ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
7979
else()
8080
message(FATAL_ERROR "Can't understand SOURCEKIT_DEPLOYMENT_OS '${SOURCEKIT_DEPLOYMENT_OS}';")
8181
endif()
82-
83-
# Add deployment target to C/C++ compiler and linker flags.
84-
# FIXME: CMAKE_OSX_DEPLOYMENT_TARGET falls over when used for iOS versions.
85-
if (XCODE)
86-
if (SOURCEKIT_DEPLOYMENT_OS MATCHES "^macosx")
87-
set(CMAKE_XCODE_ATTRIBUTE_MACOSX_DEPLOYMENT_TARGET ${SOURCEKIT_DEPLOYMENT_TARGET})
88-
else()
89-
set(CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET ${SOURCEKIT_DEPLOYMENT_TARGET})
90-
endif()
91-
endif()
9282
endif()
9383

9484
include_directories(BEFORE

0 commit comments

Comments
 (0)