From 72b7aed885568703dcccfca9ccbdd0f78e0f4ddb Mon Sep 17 00:00:00 2001 From: mitras-git Date: Thu, 16 Jul 2026 08:09:41 -0400 Subject: [PATCH] add license headers and set BUILD_TESTING to OFF by default --- CMakeLists.txt | 16 +++++++++++++++- Sources/CMakeLists.txt | 14 ++++++++++++++ Sources/InMemoryLogging/CMakeLists.txt | 14 ++++++++++++++ Sources/Logging/CMakeLists.txt | 14 ++++++++++++++ Tests/CMakeLists.txt | 14 ++++++++++++++ Tests/InMemoryLoggingTests/CMakeLists.txt | 22 ++++++++++++++++++++-- Tests/LoggingTests/CMakeLists.txt | 22 ++++++++++++++++++++-- cmake/modules/SwiftLogConfig.cmake.in | 14 ++++++++++++++ cmake/modules/SwiftSupport.cmake | 14 ++++++++++++++ 9 files changed, 139 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f8f4f38..21101ac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,10 +1,24 @@ +#===----------------------------------------------------------------------===# +# +# This source file is part of the Swift Logging API open source project +# +# Copyright (c) 2018-2026 Apple Inc. and the Swift Logging API project authors +# Licensed under Apache License v2.0 +# +# See LICENSE.txt for license information +# See CONTRIBUTORS.txt for the list of Swift Logging API project authors +# +# SPDX-License-Identifier: Apache-2.0 +# +#===----------------------------------------------------------------------===# + 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_TESTING "Build testing targets" OFF) option(BUILD_SHARED_LIBS "Build shared libraries by default" YES) set(CMAKE_Swift_LANGUAGE_VERSION 6) diff --git a/Sources/CMakeLists.txt b/Sources/CMakeLists.txt index 9eb9a5e..bb80ef1 100644 --- a/Sources/CMakeLists.txt +++ b/Sources/CMakeLists.txt @@ -1,2 +1,16 @@ +#===----------------------------------------------------------------------===# +# +# This source file is part of the Swift Logging API open source project +# +# Copyright (c) 2018-2026 Apple Inc. and the Swift Logging API project authors +# Licensed under Apache License v2.0 +# +# See LICENSE.txt for license information +# See CONTRIBUTORS.txt for the list of Swift Logging API project authors +# +# SPDX-License-Identifier: Apache-2.0 +# +#===----------------------------------------------------------------------===# + add_subdirectory(Logging) add_subdirectory(InMemoryLogging) diff --git a/Sources/InMemoryLogging/CMakeLists.txt b/Sources/InMemoryLogging/CMakeLists.txt index eae3869..11ce92c 100644 --- a/Sources/InMemoryLogging/CMakeLists.txt +++ b/Sources/InMemoryLogging/CMakeLists.txt @@ -1,3 +1,17 @@ +#===----------------------------------------------------------------------===# +# +# This source file is part of the Swift Logging API open source project +# +# Copyright (c) 2018-2026 Apple Inc. and the Swift Logging API project authors +# Licensed under Apache License v2.0 +# +# See LICENSE.txt for license information +# See CONTRIBUTORS.txt for the list of Swift Logging API project authors +# +# SPDX-License-Identifier: Apache-2.0 +# +#===----------------------------------------------------------------------===# + add_library(InMemoryLogging "InMemoryLogHandler.swift" ) diff --git a/Sources/Logging/CMakeLists.txt b/Sources/Logging/CMakeLists.txt index 4604416..936e1be 100644 --- a/Sources/Logging/CMakeLists.txt +++ b/Sources/Logging/CMakeLists.txt @@ -1,3 +1,17 @@ +#===----------------------------------------------------------------------===# +# +# This source file is part of the Swift Logging API open source project +# +# Copyright (c) 2018-2026 Apple Inc. and the Swift Logging API project authors +# Licensed under Apache License v2.0 +# +# See LICENSE.txt for license information +# See CONTRIBUTORS.txt for the list of Swift Logging API project authors +# +# SPDX-License-Identifier: Apache-2.0 +# +#===----------------------------------------------------------------------===# + add_library(Logging "Handlers/MultiplexLogHandler.swift" "Handlers/StreamLogHandler.swift" diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 23ae49c..4017fa1 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1,2 +1,16 @@ +#===----------------------------------------------------------------------===# +# +# This source file is part of the Swift Logging API open source project +# +# Copyright (c) 2018-2026 Apple Inc. and the Swift Logging API project authors +# Licensed under Apache License v2.0 +# +# See LICENSE.txt for license information +# See CONTRIBUTORS.txt for the list of Swift Logging API project authors +# +# SPDX-License-Identifier: Apache-2.0 +# +#===----------------------------------------------------------------------===# + add_subdirectory(LoggingTests) add_subdirectory(InMemoryLoggingTests) diff --git a/Tests/InMemoryLoggingTests/CMakeLists.txt b/Tests/InMemoryLoggingTests/CMakeLists.txt index add1265..3cca5fe 100644 --- a/Tests/InMemoryLoggingTests/CMakeLists.txt +++ b/Tests/InMemoryLoggingTests/CMakeLists.txt @@ -1,3 +1,17 @@ +#===----------------------------------------------------------------------===# +# +# This source file is part of the Swift Logging API open source project +# +# Copyright (c) 2018-2026 Apple Inc. and the Swift Logging API project authors +# Licensed under Apache License v2.0 +# +# See LICENSE.txt for license information +# See CONTRIBUTORS.txt for the list of Swift Logging API project authors +# +# SPDX-License-Identifier: Apache-2.0 +# +#===----------------------------------------------------------------------===# + if(APPLE) add_library(InMemoryLoggingTests MODULE InMemoryLogHandlerTests.swift) @@ -10,8 +24,12 @@ else() endif() target_compile_options(InMemoryLoggingTests PRIVATE - ${SWIFT_LOG_COMMON_COMPILE_OPTIONS} - "SHELL:-plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/plugins/testing") + ${SWIFT_LOG_COMMON_COMPILE_OPTIONS}) + +if(APPLE) + target_compile_options(InMemoryLoggingTests PRIVATE + "SHELL:-plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/plugins/testing") +endif() if(APPLE) find_library(TESTING_FRAMEWORK Testing diff --git a/Tests/LoggingTests/CMakeLists.txt b/Tests/LoggingTests/CMakeLists.txt index 26a1e46..42ddf2f 100644 --- a/Tests/LoggingTests/CMakeLists.txt +++ b/Tests/LoggingTests/CMakeLists.txt @@ -1,3 +1,17 @@ +#===----------------------------------------------------------------------===# +# +# This source file is part of the Swift Logging API open source project +# +# Copyright (c) 2018-2026 Apple Inc. and the Swift Logging API project authors +# Licensed under Apache License v2.0 +# +# See LICENSE.txt for license information +# See CONTRIBUTORS.txt for the list of Swift Logging API project authors +# +# SPDX-License-Identifier: Apache-2.0 +# +#===----------------------------------------------------------------------===# + if(APPLE) add_library(LoggingTests MODULE CompatibilityTest.swift @@ -40,8 +54,12 @@ else() endif() target_compile_options(LoggingTests PRIVATE - ${SWIFT_LOG_COMMON_COMPILE_OPTIONS} - "SHELL:-plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/plugins/testing") + ${SWIFT_LOG_COMMON_COMPILE_OPTIONS}) + +if(APPLE) + target_compile_options(LoggingTests PRIVATE + "SHELL:-plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/plugins/testing") +endif() if(APPLE) find_library(TESTING_FRAMEWORK Testing diff --git a/cmake/modules/SwiftLogConfig.cmake.in b/cmake/modules/SwiftLogConfig.cmake.in index 7cb9b73..ac89090 100644 --- a/cmake/modules/SwiftLogConfig.cmake.in +++ b/cmake/modules/SwiftLogConfig.cmake.in @@ -1,3 +1,17 @@ +#===----------------------------------------------------------------------===# +# +# This source file is part of the Swift Logging API open source project +# +# Copyright (c) 2018-2026 Apple Inc. and the Swift Logging API project authors +# Licensed under Apache License v2.0 +# +# See LICENSE.txt for license information +# See CONTRIBUTORS.txt for the list of Swift Logging API project authors +# +# SPDX-License-Identifier: Apache-2.0 +# +#===----------------------------------------------------------------------===# + if(NOT TARGET Logging) include(@SwiftLog_EXPORTS_FILE@) endif() diff --git a/cmake/modules/SwiftSupport.cmake b/cmake/modules/SwiftSupport.cmake index ae741d3..7e23868 100644 --- a/cmake/modules/SwiftSupport.cmake +++ b/cmake/modules/SwiftSupport.cmake @@ -1,4 +1,18 @@ +#===----------------------------------------------------------------------===# +# +# This source file is part of the Swift Logging API open source project +# +# Copyright (c) 2018-2026 Apple Inc. and the Swift Logging API project authors +# Licensed under Apache License v2.0 +# +# See LICENSE.txt for license information +# See CONTRIBUTORS.txt for the list of Swift Logging API project authors +# +# SPDX-License-Identifier: Apache-2.0 +# +#===----------------------------------------------------------------------===# + # Returns the os name in a variable # # Usage: