mirror of
https://github.com/apple/swift-log
synced 2026-11-25 03:57:48 +00:00
add root CMakeLists.txt and exclude CMakeLists.txt in Package files
This commit is contained in:
1 parent
8c0b42393a
commit
99c554b47c
3 files changed
+51
-8
No files matched your search
@@ -0,0 +1,35 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.19)
|
||||||
|
|
||||||
|
# Enable C and Swift languages
|
||||||
|
project(swift-log
|
||||||
|
LANGUAGES C Swift)
|
||||||
|
|
||||||
|
option(BUILD_TESTING "Build testing targets" ON)
|
||||||
|
option(BUILD_SHARED_LIBS "Build shared libraries by default" YES)
|
||||||
|
|
||||||
|
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
|
||||||
|
|
||||||
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||||
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||||
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||||
|
|
||||||
|
set(CMAKE_Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/swift)
|
||||||
|
|
||||||
|
include(CTest)
|
||||||
|
include(GNUInstallDirs)
|
||||||
|
include(SwiftSupport)
|
||||||
|
|
||||||
|
if(NOT APPLE)
|
||||||
|
find_package(dispatch QUIET)
|
||||||
|
find_package(Foundation QUIET)
|
||||||
|
if(BUILD_TESTING)
|
||||||
|
find_package(XCTest CONFIG QUIET)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_subdirectory(Sources)
|
||||||
|
if(BUILD_TESTING)
|
||||||
|
add_subdirectory(Tests)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_subdirectory(cmake/modules)
|
||||||
+8
-4
@@ -29,19 +29,23 @@ let package = Package(
|
|||||||
targets: [
|
targets: [
|
||||||
.target(
|
.target(
|
||||||
name: "Logging",
|
name: "Logging",
|
||||||
dependencies: []
|
dependencies: [],
|
||||||
|
exclude: ["CMakeLists.txt"]
|
||||||
),
|
),
|
||||||
.target(
|
.target(
|
||||||
name: "InMemoryLogging",
|
name: "InMemoryLogging",
|
||||||
dependencies: ["Logging"]
|
dependencies: ["Logging"],
|
||||||
|
exclude: ["CMakeLists.txt"]
|
||||||
),
|
),
|
||||||
.testTarget(
|
.testTarget(
|
||||||
name: "LoggingTests",
|
name: "LoggingTests",
|
||||||
dependencies: ["Logging"]
|
dependencies: ["Logging"],
|
||||||
|
exclude: ["CMakeLists.txt"]
|
||||||
),
|
),
|
||||||
.testTarget(
|
.testTarget(
|
||||||
name: "InMemoryLoggingTests",
|
name: "InMemoryLoggingTests",
|
||||||
dependencies: ["InMemoryLogging", "Logging"]
|
dependencies: ["InMemoryLogging", "Logging"],
|
||||||
|
exclude: ["CMakeLists.txt"]
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -29,19 +29,23 @@ let package = Package(
|
|||||||
targets: [
|
targets: [
|
||||||
.target(
|
.target(
|
||||||
name: "Logging",
|
name: "Logging",
|
||||||
dependencies: []
|
dependencies: [],
|
||||||
|
exclude: ["CMakeLists.txt"]
|
||||||
),
|
),
|
||||||
.target(
|
.target(
|
||||||
name: "InMemoryLogging",
|
name: "InMemoryLogging",
|
||||||
dependencies: ["Logging"]
|
dependencies: ["Logging"],
|
||||||
|
exclude: ["CMakeLists.txt"]
|
||||||
),
|
),
|
||||||
.testTarget(
|
.testTarget(
|
||||||
name: "LoggingTests",
|
name: "LoggingTests",
|
||||||
dependencies: ["Logging"]
|
dependencies: ["Logging"],
|
||||||
|
exclude: ["CMakeLists.txt"]
|
||||||
),
|
),
|
||||||
.testTarget(
|
.testTarget(
|
||||||
name: "InMemoryLoggingTests",
|
name: "InMemoryLoggingTests",
|
||||||
dependencies: ["InMemoryLogging", "Logging"]
|
dependencies: ["InMemoryLogging", "Logging"],
|
||||||
|
exclude: ["CMakeLists.txt"]
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in new issue
Block a user