add root CMakeLists.txt and exclude CMakeLists.txt in Package files

This commit is contained in:
mitras-git committed 2026-07-12 14:06:23 -04:00
1 parent 8c0b42393a
commit 99c554b47c
3 files changed
+51 -8

No files matched your search

+35
View File
@@ -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
View File
@@ -29,19 +29,23 @@ let package = Package(
targets: [
.target(
name: "Logging",
dependencies: []
dependencies: [],
exclude: ["CMakeLists.txt"]
),
.target(
name: "InMemoryLogging",
dependencies: ["Logging"]
dependencies: ["Logging"],
exclude: ["CMakeLists.txt"]
),
.testTarget(
name: "LoggingTests",
dependencies: ["Logging"]
dependencies: ["Logging"],
exclude: ["CMakeLists.txt"]
),
.testTarget(
name: "InMemoryLoggingTests",
dependencies: ["InMemoryLogging", "Logging"]
dependencies: ["InMemoryLogging", "Logging"],
exclude: ["CMakeLists.txt"]
),
]
)
+8 -4
View File
@@ -29,19 +29,23 @@ let package = Package(
targets: [
.target(
name: "Logging",
dependencies: []
dependencies: [],
exclude: ["CMakeLists.txt"]
),
.target(
name: "InMemoryLogging",
dependencies: ["Logging"]
dependencies: ["Logging"],
exclude: ["CMakeLists.txt"]
),
.testTarget(
name: "LoggingTests",
dependencies: ["Logging"]
dependencies: ["Logging"],
exclude: ["CMakeLists.txt"]
),
.testTarget(
name: "InMemoryLoggingTests",
dependencies: ["InMemoryLogging", "Logging"]
dependencies: ["InMemoryLogging", "Logging"],
exclude: ["CMakeLists.txt"]
),
]
)