Skip to content

Commit cca3398

Browse files
authored
Merge pull request #7517 from gottesmm/revert_cmake_changes
2 parents 9178030 + 8437819 commit cca3398

File tree

77 files changed

+417
-474
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+417
-474
lines changed

CMakeLists.txt

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -459,9 +459,6 @@ endif()
459459

460460
set(SWIFT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
461461
set(SWIFT_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
462-
set(SWIFT_CMAKE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
463-
set(SWIFT_MAIN_INCLUDE_DIR "${SWIFT_SOURCE_DIR}/include")
464-
set(SWIFT_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/include")
465462

466463
set(SWIFT_RUNTIME_OUTPUT_INTDIR "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin")
467464
set(SWIFT_LIBRARY_OUTPUT_INTDIR "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib")
@@ -482,8 +479,8 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
482479

483480
# We'll need this once we have generated headers
484481
include_directories(BEFORE
485-
${SWIFT_MAIN_INCLUDE_DIR}
486-
${SWIFT_INCLUDE_DIR}
482+
${CMAKE_CURRENT_BINARY_DIR}/include
483+
${CMAKE_CURRENT_SOURCE_DIR}/include
487484
)
488485

489486
# A convenience pattern to match Darwin platforms. Example:
@@ -957,8 +954,6 @@ if(SWIFT_INCLUDE_DOCS)
957954
add_subdirectory(docs)
958955
endif()
959956

960-
add_subdirectory(cmake/modules)
961-
962957
swift_install_in_component(license
963958
FILES "LICENSE.txt"
964959
DESTINATION "share/swift")

cmake/modules/AddSwift.cmake

Lines changed: 320 additions & 324 deletions
Large diffs are not rendered by default.

cmake/modules/CMakeLists.txt

Lines changed: 0 additions & 19 deletions
This file was deleted.

cmake/modules/SwiftConfig.cmake.in

Lines changed: 0 additions & 28 deletions
This file was deleted.

lib/AST/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,11 @@ add_swift_library(swiftAST STATIC
5555
TypeRepr.cpp
5656
TypeWalker.cpp
5757
USRGeneration.cpp
58-
LINK_LIBS
58+
LINK_LIBRARIES
5959
swiftMarkup
6060
swiftBasic
6161

62+
INTERFACE_LINK_LIBRARIES
6263
# Clang dependencies.
6364
# FIXME: Clang should really export these in some reasonable manner.
6465
clangCodeGen
@@ -80,7 +81,7 @@ add_swift_library(swiftAST STATIC
8081
clangAPINotes
8182
clangBasic
8283

83-
LINK_COMPONENTS
84+
LLVM_COMPONENT_DEPENDS
8485
bitreader bitwriter coroutines coverage irreader debuginfoDWARF
8586
profiledata instrumentation object objcarcopts mc mcparser
8687
bitreader bitwriter lto ipo option core support ${LLVM_TARGETS_TO_BUILD}

lib/ASTSectionImporter/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
add_swift_library(swiftASTSectionImporter STATIC
22
ASTSectionImporter.cpp
3-
LINK_LIBS swiftBasic
4-
LINK_COMPONENTS core)
3+
LINK_LIBRARIES swiftBasic
4+
LLVM_COMPONENT_DEPENDS core)
55

lib/Basic/CMakeLists.txt

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11

22
# On non-Darwin require UUID.
3-
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
3+
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
4+
set(UUID_INCLUDE "")
5+
set(UUID_LIBRARIES "")
6+
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
7+
set(UUID_INCLUDE "")
48
set(UUID_LIBRARIES "ole32.lib")
5-
elseif(NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin")
9+
else()
610
find_package(UUID REQUIRED)
7-
include_directories(AFTER ${UUID_INCLUDE_DIRS})
11+
set(UUID_INCLUDE "-I${UUID_INCLUDE_DIRS}")
812
endif()
913

1014
# Figure out if we can track VC revisions.
@@ -60,13 +64,6 @@ generate_revision_inc(swift_revision_inc Swift "${SWIFT_SOURCE_DIR}")
6064
set(version_inc_files
6165
${llvm_revision_inc} ${clang_revision_inc} ${swift_revision_inc})
6266

63-
set(generated_include_sources UnicodeExtendedGraphemeClusters.cpp.gyb)
64-
65-
handle_gyb_sources(
66-
generated_include_targets
67-
generated_include_sources
68-
"")
69-
7067
add_swift_library(swiftBasic STATIC
7168
Cache.cpp
7269
ClusteredBitVector.cpp
@@ -109,11 +106,11 @@ add_swift_library(swiftBasic STATIC
109106
# Platform-agnostic fallback TaskQueue implementation
110107
Default/TaskQueue.inc
111108

112-
${generated_include_sources}
109+
UnicodeExtendedGraphemeClusters.cpp.gyb
113110

114-
LINK_LIBS ${UUID_LIBRARIES}
115-
LINK_COMPONENTS support
116-
DEPENDS ${generated_include_targets})
111+
C_COMPILE_FLAGS ${UUID_INCLUDE}
112+
LINK_LIBRARIES ${UUID_LIBRARIES}
113+
LLVM_COMPONENT_DEPENDS support)
117114

118115
message(STATUS "Swift version: ${SWIFT_VERSION}")
119116
message(STATUS "Swift vendor: ${SWIFT_VENDOR}")

lib/ClangImporter/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ add_swift_library(swiftClangImporter STATIC
2020
ImportName.cpp
2121
ImportType.cpp
2222
SwiftLookupTable.cpp
23-
LINK_LIBS
23+
LINK_LIBRARIES
2424
swiftAST
2525
swiftParse
2626
)

lib/Driver/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ set(swiftDriver_targetDefines)
1717
add_swift_library(swiftDriver STATIC
1818
${swiftDriver_sources}
1919
DEPENDS SwiftOptions
20-
LINK_LIBS swiftAST swiftBasic swiftFrontend swiftOption)
20+
LINK_LIBRARIES swiftAST swiftBasic swiftFrontend swiftOption)
2121

2222
# Generate the static-stdlib-args.lnk file used by -static-stdlib option
2323
# for 'GenericUnix' (eg linux)

lib/Frontend/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ add_swift_library(swiftFrontend STATIC
1313
SerializedDiagnosticConsumer.cpp
1414
${AppleHostVersionDetection}
1515
DEPENDS SwiftOptions
16-
LINK_LIBS
16+
LINK_LIBRARIES
1717
swiftSIL
1818
swiftOption
1919
swiftParse

lib/FrontendTool/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ add_swift_library(swiftFrontendTool STATIC
22
FrontendTool.cpp
33
ReferenceDependencies.cpp
44
DEPENDS SwiftOptions
5-
LINK_LIBS
5+
LINK_LIBRARIES
66
swiftIDE
77
swiftIRGen swiftSIL swiftSILGen swiftSILOptimizer
88
swiftImmediate

lib/IDE/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ add_swift_library(swiftIDE STATIC
99
SwiftSourceDocInfo.cpp
1010
SyntaxModel.cpp
1111
Utils.cpp
12-
LINK_LIBS
12+
LINK_LIBRARIES
1313
swiftFrontend
1414
swiftClangImporter
1515
swiftParse

lib/IRGen/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ add_swift_library(swiftIRGen STATIC
4141
StructLayout.cpp
4242
SwiftTargetInfo.cpp
4343
TypeLayoutVerifier.cpp
44-
LINK_LIBS
44+
LINK_LIBRARIES
4545
swiftAST
4646
swiftLLVMPasses
4747
swiftSIL

lib/Immediate/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
add_swift_library(swiftImmediate STATIC
22
Immediate.cpp
33
REPL.cpp
4-
LINK_LIBS
4+
LINK_LIBRARIES
55
swiftIDE
66
swiftFrontend
77
swiftSILGen
88
swiftSILOptimizer
99
swiftIRGen
10-
LINK_COMPONENTS
10+
LLVM_COMPONENT_DEPENDS
1111
linker mcjit)
1212

lib/Index/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ add_swift_library(swiftIndex STATIC
22
Index.cpp
33
IndexDataConsumer.cpp
44
IndexSymbol.cpp
5-
LINK_LIBS
5+
LINK_LIBRARIES
66
swiftAST)

lib/LLVMPasses/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ add_swift_library(swiftLLVMPasses STATIC
66
LLVMInlineTree.cpp
77
LLVMMergeFunctions.cpp
88

9-
LINK_COMPONENTS
9+
LLVM_COMPONENT_DEPENDS
1010
analysis
1111
)
1212

lib/Markup/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ add_swift_library(swiftMarkup STATIC
33
LineList.cpp
44
Markup.cpp
55

6-
LINK_LIBS
6+
LINK_LIBRARIES
77
libcmark_static)
88

lib/Option/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ add_swift_library(swiftOption STATIC
22
Options.cpp
33
SanitizerOptions.cpp
44
DEPENDS SwiftOptions
5-
LINK_LIBS swiftBasic)
5+
LINK_LIBRARIES swiftBasic
6+
FILE_DEPENDS SwiftOptions)
67

lib/Parse/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ add_swift_library(swiftParse STATIC
1010
ParseType.cpp
1111
PersistentParserState.cpp
1212
Scope.cpp
13-
LINK_LIBS
13+
LINK_LIBRARIES
1414
swiftSIL
1515
swiftAST
1616
)

lib/PrintAsObjC/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
add_swift_library(swiftPrintAsObjC STATIC
22
PrintAsObjC.cpp
33

4-
LINK_LIBS
4+
LINK_LIBRARIES
55
swiftIDE
66
swiftFrontend
77
swiftClangImporter

lib/RemoteAST/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
add_swift_library(swiftRemoteAST STATIC
22
RemoteAST.cpp
33
InProcessMemoryReader.cpp
4-
LINK_LIBS
4+
LINK_LIBRARIES
55
swiftSema swiftIRGen)

lib/SIL/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ add_swift_library(swiftSIL STATIC
3333
SILVTable.cpp
3434
SILWitnessTable.cpp
3535
TypeLowering.cpp
36-
LINK_LIBS
36+
LINK_LIBRARIES
3737
swiftSerialization
3838
swiftSema
3939
)

lib/SILGen/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ add_swift_library(swiftSILGen STATIC
2828
SILGenProlog.cpp
2929
SILGenStmt.cpp
3030
SILGenType.cpp
31-
LINK_LIBS
31+
LINK_LIBRARIES
3232
swiftSIL
3333
)

lib/SILOptimizer/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ add_swift_library(swiftSILOptimizer STATIC
1919
${MANDATORY_SOURCES}
2020
${TRANSFORMS_SOURCES}
2121
${IPO_SOURCES}
22-
LINK_LIBS swiftSIL)
22+
LINK_LIBRARIES swiftSIL)

lib/Sema/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ add_swift_library(swiftSema STATIC
4747
TypeCheckStmt.cpp
4848
TypeCheckType.cpp
4949
TypeChecker.cpp
50-
LINK_LIBS
50+
LINK_LIBRARIES
5151
swiftParse
5252
swiftAST
5353
${EXTRA_TYPECHECKER_FLAGS}

lib/Serialization/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ add_swift_library(swiftSerialization STATIC
66
SerializedModuleLoader.cpp
77
SerializedSILLoader.cpp
88
SerializeSIL.cpp
9-
LINK_LIBS
9+
LINK_LIBRARIES
1010
swiftClangImporter)
1111

lib/SwiftDemangle/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
add_swift_library(swiftDemangle SHARED
22
SwiftDemangle.cpp
33
MangleHack.cpp
4-
LINK_LIBS swiftBasic)
4+
LINK_LIBRARIES swiftBasic)
55

66
swift_install_in_component(compiler
77
TARGETS swiftDemangle

stdlib/internal/SwiftExperimental/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_swift_target_library(swiftSwiftExperimental ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
1+
add_swift_library(swiftSwiftExperimental ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
22
# This file should be listed the first. Module name is inferred from the
33
# filename.
44
SwiftExperimental.swift

stdlib/private/StdlibCollectionUnittest/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ endif()
55

66
# TODO: support this on non-POSIX platforms. It cannot be currently as it
77
# depends on pthreads.
8-
add_swift_target_library(swiftStdlibCollectionUnittest ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
8+
add_swift_library(swiftStdlibCollectionUnittest ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
99
# This file should be listed the first. Module name is inferred from the
1010
# filename.
1111
StdlibCollectionUnittest.swift

stdlib/private/StdlibUnicodeUnittest/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ endif()
55

66
# TODO: support this on non-POSIX platforms. It cannot be currently as it
77
# depends on pthreads.
8-
add_swift_target_library(swiftStdlibUnicodeUnittest ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
8+
add_swift_library(swiftStdlibUnicodeUnittest ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
99
# This file should be listed the first. Module name is inferred from the
1010
# filename.
1111
StdlibUnicodeUnittest.swift

stdlib/private/StdlibUnittest/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ endif()
1010

1111
# TODO: support this on non-POSIX platforms. It cannot be currently as it
1212
# depends on pthreads.
13-
add_swift_target_library(swiftStdlibUnittest ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
13+
add_swift_library(swiftStdlibUnittest ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
1414
# This file should be listed the first. Module name is inferred from the
1515
# filename.
1616
StdlibUnittest.swift.gyb

stdlib/private/StdlibUnittestFoundationExtras/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_swift_target_library(swiftStdlibUnittestFoundationExtras ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
1+
add_swift_library(swiftStdlibUnittestFoundationExtras ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
22
# This file should be listed the first. Module name is inferred from the
33
# filename.
44
StdlibUnittestFoundationExtras.swift

stdlib/private/SwiftPrivate/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_swift_target_library(swiftSwiftPrivate ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
1+
add_swift_library(swiftSwiftPrivate ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
22
# This file should be listed the first. Module name is inferred from the
33
# filename.
44
SwiftPrivate.swift

stdlib/private/SwiftPrivateLibcExtras/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_swift_target_library(swiftSwiftPrivateLibcExtras ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
1+
add_swift_library(swiftSwiftPrivateLibcExtras ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
22
# This file should be listed the first. Module name is inferred from the
33
# filename.
44
SwiftPrivateLibcExtras.swift

stdlib/private/SwiftPrivatePthreadExtras/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_swift_target_library(swiftSwiftPrivatePthreadExtras ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
1+
add_swift_library(swiftSwiftPrivatePthreadExtras ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
22
# This file should be listed the first. Module name is inferred from the
33
# filename.
44
SwiftPrivatePthreadExtras.swift

stdlib/private/SwiftReflectionTest/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
if (SWIFT_INCLUDE_TESTS)
3-
add_swift_target_library(swiftSwiftReflectionTest ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
3+
add_swift_library(swiftSwiftReflectionTest ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
44
SwiftReflectionTest.swift
55
SWIFT_MODULE_DEPENDS Darwin
66
TARGET_SDKS ALL_APPLE_PLATFORMS

0 commit comments

Comments
 (0)