Skip to content

[CMake] Revert recent changes. #7517

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
Feb 16, 2017
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
9 changes: 2 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -459,9 +459,6 @@ endif()

set(SWIFT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
set(SWIFT_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
set(SWIFT_CMAKE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
set(SWIFT_MAIN_INCLUDE_DIR "${SWIFT_SOURCE_DIR}/include")
set(SWIFT_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/include")

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

# We'll need this once we have generated headers
include_directories(BEFORE
${SWIFT_MAIN_INCLUDE_DIR}
${SWIFT_INCLUDE_DIR}
${CMAKE_CURRENT_BINARY_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/include
)

# A convenience pattern to match Darwin platforms. Example:
Expand Down Expand Up @@ -957,8 +954,6 @@ if(SWIFT_INCLUDE_DOCS)
add_subdirectory(docs)
endif()

add_subdirectory(cmake/modules)

swift_install_in_component(license
FILES "LICENSE.txt"
DESTINATION "share/swift")
Expand Down
644 changes: 320 additions & 324 deletions cmake/modules/AddSwift.cmake

Large diffs are not rendered by default.

19 changes: 0 additions & 19 deletions cmake/modules/CMakeLists.txt

This file was deleted.

28 changes: 0 additions & 28 deletions cmake/modules/SwiftConfig.cmake.in

This file was deleted.

5 changes: 3 additions & 2 deletions lib/AST/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@ add_swift_library(swiftAST STATIC
TypeRepr.cpp
TypeWalker.cpp
USRGeneration.cpp
LINK_LIBS
LINK_LIBRARIES
swiftMarkup
swiftBasic

INTERFACE_LINK_LIBRARIES
# Clang dependencies.
# FIXME: Clang should really export these in some reasonable manner.
clangCodeGen
Expand All @@ -80,7 +81,7 @@ add_swift_library(swiftAST STATIC
clangAPINotes
clangBasic

LINK_COMPONENTS
LLVM_COMPONENT_DEPENDS
bitreader bitwriter coroutines coverage irreader debuginfoDWARF
profiledata instrumentation object objcarcopts mc mcparser
bitreader bitwriter lto ipo option core support ${LLVM_TARGETS_TO_BUILD}
Expand Down
4 changes: 2 additions & 2 deletions lib/ASTSectionImporter/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
add_swift_library(swiftASTSectionImporter STATIC
ASTSectionImporter.cpp
LINK_LIBS swiftBasic
LINK_COMPONENTS core)
LINK_LIBRARIES swiftBasic
LLVM_COMPONENT_DEPENDS core)

25 changes: 11 additions & 14 deletions lib/Basic/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@

# On non-Darwin require UUID.
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(UUID_INCLUDE "")
set(UUID_LIBRARIES "")
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
set(UUID_INCLUDE "")
set(UUID_LIBRARIES "ole32.lib")
elseif(NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin")
else()
find_package(UUID REQUIRED)
include_directories(AFTER ${UUID_INCLUDE_DIRS})
set(UUID_INCLUDE "-I${UUID_INCLUDE_DIRS}")
endif()

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

set(generated_include_sources UnicodeExtendedGraphemeClusters.cpp.gyb)

handle_gyb_sources(
generated_include_targets
generated_include_sources
"")

add_swift_library(swiftBasic STATIC
Cache.cpp
ClusteredBitVector.cpp
Expand Down Expand Up @@ -109,11 +106,11 @@ add_swift_library(swiftBasic STATIC
# Platform-agnostic fallback TaskQueue implementation
Default/TaskQueue.inc

${generated_include_sources}
UnicodeExtendedGraphemeClusters.cpp.gyb

LINK_LIBS ${UUID_LIBRARIES}
LINK_COMPONENTS support
DEPENDS ${generated_include_targets})
C_COMPILE_FLAGS ${UUID_INCLUDE}
LINK_LIBRARIES ${UUID_LIBRARIES}
LLVM_COMPONENT_DEPENDS support)

message(STATUS "Swift version: ${SWIFT_VERSION}")
message(STATUS "Swift vendor: ${SWIFT_VENDOR}")
Expand Down
2 changes: 1 addition & 1 deletion lib/ClangImporter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ add_swift_library(swiftClangImporter STATIC
ImportName.cpp
ImportType.cpp
SwiftLookupTable.cpp
LINK_LIBS
LINK_LIBRARIES
swiftAST
swiftParse
)
Expand Down
2 changes: 1 addition & 1 deletion lib/Driver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ set(swiftDriver_targetDefines)
add_swift_library(swiftDriver STATIC
${swiftDriver_sources}
DEPENDS SwiftOptions
LINK_LIBS swiftAST swiftBasic swiftFrontend swiftOption)
LINK_LIBRARIES swiftAST swiftBasic swiftFrontend swiftOption)

# Generate the static-stdlib-args.lnk file used by -static-stdlib option
# for 'GenericUnix' (eg linux)
Expand Down
2 changes: 1 addition & 1 deletion lib/Frontend/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ add_swift_library(swiftFrontend STATIC
SerializedDiagnosticConsumer.cpp
${AppleHostVersionDetection}
DEPENDS SwiftOptions
LINK_LIBS
LINK_LIBRARIES
swiftSIL
swiftOption
swiftParse
Expand Down
2 changes: 1 addition & 1 deletion lib/FrontendTool/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ add_swift_library(swiftFrontendTool STATIC
FrontendTool.cpp
ReferenceDependencies.cpp
DEPENDS SwiftOptions
LINK_LIBS
LINK_LIBRARIES
swiftIDE
swiftIRGen swiftSIL swiftSILGen swiftSILOptimizer
swiftImmediate
Expand Down
2 changes: 1 addition & 1 deletion lib/IDE/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ add_swift_library(swiftIDE STATIC
SwiftSourceDocInfo.cpp
SyntaxModel.cpp
Utils.cpp
LINK_LIBS
LINK_LIBRARIES
swiftFrontend
swiftClangImporter
swiftParse
Expand Down
2 changes: 1 addition & 1 deletion lib/IRGen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ add_swift_library(swiftIRGen STATIC
StructLayout.cpp
SwiftTargetInfo.cpp
TypeLayoutVerifier.cpp
LINK_LIBS
LINK_LIBRARIES
swiftAST
swiftLLVMPasses
swiftSIL
Expand Down
4 changes: 2 additions & 2 deletions lib/Immediate/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
add_swift_library(swiftImmediate STATIC
Immediate.cpp
REPL.cpp
LINK_LIBS
LINK_LIBRARIES
swiftIDE
swiftFrontend
swiftSILGen
swiftSILOptimizer
swiftIRGen
LINK_COMPONENTS
LLVM_COMPONENT_DEPENDS
linker mcjit)

2 changes: 1 addition & 1 deletion lib/Index/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ add_swift_library(swiftIndex STATIC
Index.cpp
IndexDataConsumer.cpp
IndexSymbol.cpp
LINK_LIBS
LINK_LIBRARIES
swiftAST)
2 changes: 1 addition & 1 deletion lib/LLVMPasses/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ add_swift_library(swiftLLVMPasses STATIC
LLVMInlineTree.cpp
LLVMMergeFunctions.cpp

LINK_COMPONENTS
LLVM_COMPONENT_DEPENDS
analysis
)

2 changes: 1 addition & 1 deletion lib/Markup/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ add_swift_library(swiftMarkup STATIC
LineList.cpp
Markup.cpp

LINK_LIBS
LINK_LIBRARIES
libcmark_static)

3 changes: 2 additions & 1 deletion lib/Option/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ add_swift_library(swiftOption STATIC
Options.cpp
SanitizerOptions.cpp
DEPENDS SwiftOptions
LINK_LIBS swiftBasic)
LINK_LIBRARIES swiftBasic
FILE_DEPENDS SwiftOptions)

2 changes: 1 addition & 1 deletion lib/Parse/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ add_swift_library(swiftParse STATIC
ParseType.cpp
PersistentParserState.cpp
Scope.cpp
LINK_LIBS
LINK_LIBRARIES
swiftSIL
swiftAST
)
Expand Down
2 changes: 1 addition & 1 deletion lib/PrintAsObjC/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
add_swift_library(swiftPrintAsObjC STATIC
PrintAsObjC.cpp

LINK_LIBS
LINK_LIBRARIES
swiftIDE
swiftFrontend
swiftClangImporter
Expand Down
2 changes: 1 addition & 1 deletion lib/RemoteAST/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
add_swift_library(swiftRemoteAST STATIC
RemoteAST.cpp
InProcessMemoryReader.cpp
LINK_LIBS
LINK_LIBRARIES
swiftSema swiftIRGen)
2 changes: 1 addition & 1 deletion lib/SIL/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ add_swift_library(swiftSIL STATIC
SILVTable.cpp
SILWitnessTable.cpp
TypeLowering.cpp
LINK_LIBS
LINK_LIBRARIES
swiftSerialization
swiftSema
)
Expand Down
2 changes: 1 addition & 1 deletion lib/SILGen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ add_swift_library(swiftSILGen STATIC
SILGenProlog.cpp
SILGenStmt.cpp
SILGenType.cpp
LINK_LIBS
LINK_LIBRARIES
swiftSIL
)
2 changes: 1 addition & 1 deletion lib/SILOptimizer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ add_swift_library(swiftSILOptimizer STATIC
${MANDATORY_SOURCES}
${TRANSFORMS_SOURCES}
${IPO_SOURCES}
LINK_LIBS swiftSIL)
LINK_LIBRARIES swiftSIL)
2 changes: 1 addition & 1 deletion lib/Sema/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ add_swift_library(swiftSema STATIC
TypeCheckStmt.cpp
TypeCheckType.cpp
TypeChecker.cpp
LINK_LIBS
LINK_LIBRARIES
swiftParse
swiftAST
${EXTRA_TYPECHECKER_FLAGS}
Expand Down
2 changes: 1 addition & 1 deletion lib/Serialization/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ add_swift_library(swiftSerialization STATIC
SerializedModuleLoader.cpp
SerializedSILLoader.cpp
SerializeSIL.cpp
LINK_LIBS
LINK_LIBRARIES
swiftClangImporter)

2 changes: 1 addition & 1 deletion lib/SwiftDemangle/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
add_swift_library(swiftDemangle SHARED
SwiftDemangle.cpp
MangleHack.cpp
LINK_LIBS swiftBasic)
LINK_LIBRARIES swiftBasic)

swift_install_in_component(compiler
TARGETS swiftDemangle
Expand Down
2 changes: 1 addition & 1 deletion stdlib/internal/SwiftExperimental/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
add_swift_target_library(swiftSwiftExperimental ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
add_swift_library(swiftSwiftExperimental ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
# This file should be listed the first. Module name is inferred from the
# filename.
SwiftExperimental.swift
Expand Down
2 changes: 1 addition & 1 deletion stdlib/private/StdlibCollectionUnittest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ endif()

# TODO: support this on non-POSIX platforms. It cannot be currently as it
# depends on pthreads.
add_swift_target_library(swiftStdlibCollectionUnittest ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
add_swift_library(swiftStdlibCollectionUnittest ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
# This file should be listed the first. Module name is inferred from the
# filename.
StdlibCollectionUnittest.swift
Expand Down
2 changes: 1 addition & 1 deletion stdlib/private/StdlibUnicodeUnittest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ endif()

# TODO: support this on non-POSIX platforms. It cannot be currently as it
# depends on pthreads.
add_swift_target_library(swiftStdlibUnicodeUnittest ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
add_swift_library(swiftStdlibUnicodeUnittest ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
# This file should be listed the first. Module name is inferred from the
# filename.
StdlibUnicodeUnittest.swift
Expand Down
2 changes: 1 addition & 1 deletion stdlib/private/StdlibUnittest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ endif()

# TODO: support this on non-POSIX platforms. It cannot be currently as it
# depends on pthreads.
add_swift_target_library(swiftStdlibUnittest ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
add_swift_library(swiftStdlibUnittest ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
# This file should be listed the first. Module name is inferred from the
# filename.
StdlibUnittest.swift.gyb
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
add_swift_target_library(swiftStdlibUnittestFoundationExtras ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
add_swift_library(swiftStdlibUnittestFoundationExtras ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
# This file should be listed the first. Module name is inferred from the
# filename.
StdlibUnittestFoundationExtras.swift
Expand Down
2 changes: 1 addition & 1 deletion stdlib/private/SwiftPrivate/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
add_swift_target_library(swiftSwiftPrivate ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
add_swift_library(swiftSwiftPrivate ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
# This file should be listed the first. Module name is inferred from the
# filename.
SwiftPrivate.swift
Expand Down
2 changes: 1 addition & 1 deletion stdlib/private/SwiftPrivateLibcExtras/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
add_swift_target_library(swiftSwiftPrivateLibcExtras ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
add_swift_library(swiftSwiftPrivateLibcExtras ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
# This file should be listed the first. Module name is inferred from the
# filename.
SwiftPrivateLibcExtras.swift
Expand Down
2 changes: 1 addition & 1 deletion stdlib/private/SwiftPrivatePthreadExtras/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
add_swift_target_library(swiftSwiftPrivatePthreadExtras ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
add_swift_library(swiftSwiftPrivatePthreadExtras ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
# This file should be listed the first. Module name is inferred from the
# filename.
SwiftPrivatePthreadExtras.swift
Expand Down
2 changes: 1 addition & 1 deletion stdlib/private/SwiftReflectionTest/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

if (SWIFT_INCLUDE_TESTS)
add_swift_target_library(swiftSwiftReflectionTest ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
add_swift_library(swiftSwiftReflectionTest ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
SwiftReflectionTest.swift
SWIFT_MODULE_DEPENDS Darwin
TARGET_SDKS ALL_APPLE_PLATFORMS
Expand Down
Loading