diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..5ce37c15 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,48 @@ +#[[ +This source file is part of the Swift open source project + +Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors +Licensed under Apache License v2.0 with Runtime Library Exception + +See http://swift.org/LICENSE.txt for license information +See http://swift.org/CONTRIBUTORS.txt for Swift project authors +]] + +cmake_minimum_required(VERSION 3.26...3.29) +project(SwiftBuild + LANGUAGES C CXX Swift) + +set(CMAKE_C_VISIBILITY hidden) +set(CMAKE_CXX_VISIBILITY hidden) +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED YES) +set(CMAKE_CXX_EXTENSIONS NO) +set(CMAKE_VISIBILITY_INLINES_HIDDEN YES) + +option(SwiftBuild_USE_LLBUILD_FRAMEWORK "Use LLBuild Framework" NO) + +add_compile_options("$<$:SHELL:-package-name SwiftBuild>" + "$<$,$,6>>:SHELL:-enable-upcoming-feature ConciseMagicFile>" + "$<$,$,6>>:SHELL:-enable-upcoming-feature DeprecateApplicationMain>" + "$<$,$,6>>:SHELL:-enable-upcoming-feature DisableOutwardActorInference>" + "$<$,$,6>>:SHELL:-enable-upcoming-feature ForwardTrailingClosures>" + "$<$,$,6>>:SHELL:-enable-upcoming-feature GlobalConcurrency>" + "$<$,$,6>>:SHELL:-enable-upcoming-feature ImplicitOpenExistentials>" + "$<$,$,6>>:SHELL:-enable-upcoming-feature ImplicitOpenExistentialsImportObjcForwardDeclarations>" + "$<$,$,6>>:SHELL:-enable-upcoming-feature InferSendableFromCaptures>" + "$<$,$,6>>:SHELL:-enable-upcoming-feature IsolatedDefaultValues>" + # rdar://127809703 + # "$<$:SHELL:-enable-upcoming-feature RegionBasedIsolation>" + "$<$:SHELL:-enable-upcoming-feature ExistentialAny>" + "$<$:SHELL:-enable-upcoming-feature InternalImportsByDefault>") + +find_package(ArgumentParser) +find_package(LLBuild) +find_package(SwiftDriver) +find_package(SwiftSystem) +find_package(TSC) +# NOTE: these two are required for LLBuild dependencies +find_package(Threads) +find_package(SQLite3) + +add_subdirectory(Sources) diff --git a/Sources/CMakeLists.txt b/Sources/CMakeLists.txt new file mode 100644 index 00000000..aa9605fe --- /dev/null +++ b/Sources/CMakeLists.txt @@ -0,0 +1,29 @@ +#[[ +This source file is part of the Swift open source project + +Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors +Licensed under Apache License v2.0 with Runtime Library Exception + +See http://swift.org/LICENSE.txt for license information +See http://swift.org/CONTRIBUTORS.txt for Swift project authors +]] + +add_subdirectory(SWBCSupport) +add_subdirectory(SWBCLibc) +add_subdirectory(SWBLibc) +add_subdirectory(SWBUtil) +add_subdirectory(SWBMacro) +add_subdirectory(SWBProtocol) +add_subdirectory(SWBServiceCore) +add_subdirectory(SWBCAS) +add_subdirectory(SWBLLBuild) +add_subdirectory(SWBCore) +add_subdirectory(SWBTaskConstruction) +add_subdirectory(SWBTaskExecution) +add_subdirectory(SWBBuildSystem) +add_subdirectory(SWBBuildService) +add_subdirectory(SWBProjectModel) +add_subdirectory(SwiftBuild) + +add_subdirectory(swbuild) +add_subdirectory(SWBBuildServiceBundle) diff --git a/Sources/SWBBuildService/CMakeLists.txt b/Sources/SWBBuildService/CMakeLists.txt new file mode 100644 index 00000000..abf9f658 --- /dev/null +++ b/Sources/SWBBuildService/CMakeLists.txt @@ -0,0 +1,32 @@ +#[[ +This source file is part of the Swift open source project + +Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors +Licensed under Apache License v2.0 with Runtime Library Exception + +See http://swift.org/LICENSE.txt for license information +See http://swift.org/CONTRIBUTORS.txt for Swift project authors +]] + +add_library(SWBBuildService + BuildDependencyInfo.swift + BuildOperationMessages.swift + BuildService.swift + BuildServiceEntryPoint.swift + ClientExchangeDelegate.swift + DependencyGraphMessages.swift + DocumentationInfo.swift + LocalizationInfo.swift + Messages.swift + PlanningOperation.swift + PreviewInfo.swift + ProjectDescriptor.swift + Session.swift + Tools.swift) +set_target_properties(SWBBuildService PROPERTIES + Swift_LANGUAGE_VERSION 5) +target_link_libraries(SWBBuildService PUBLIC + SWBBuildSystem + SWBServiceCore + SWBTaskExecution + SwiftSystem::SystemPackage) diff --git a/Sources/SWBBuildServiceBundle/CMakeLists.txt b/Sources/SWBBuildServiceBundle/CMakeLists.txt new file mode 100644 index 00000000..dcae6b91 --- /dev/null +++ b/Sources/SWBBuildServiceBundle/CMakeLists.txt @@ -0,0 +1,22 @@ +#[[ +This source file is part of the Swift open source project + +Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors +Licensed under Apache License v2.0 with Runtime Library Exception + +See http://swift.org/LICENSE.txt for license information +See http://swift.org/CONTRIBUTORS.txt for Swift project authors +]] + +add_executable(SWBBuildServiceBundle + main.swift) +set_target_properties(SWBBuildServiceBundle PROPERTIES + Swift_LANGUAGE_VERSION 6) +target_link_libraries(SWBBuildServiceBundle PRIVATE + SWBBuildService + SWBBuildSystem + SWBServiceCore + SWBUtil + SWBCore) + +install(TARGETS SWBBuildServiceBundle) diff --git a/Sources/SWBBuildSystem/CMakeLists.txt b/Sources/SWBBuildSystem/CMakeLists.txt new file mode 100644 index 00000000..7bef4f58 --- /dev/null +++ b/Sources/SWBBuildSystem/CMakeLists.txt @@ -0,0 +1,24 @@ +#[[ +This source file is part of the Swift open source project + +Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors +Licensed under Apache License v2.0 with Runtime Library Exception + +See http://swift.org/LICENSE.txt for license information +See http://swift.org/CONTRIBUTORS.txt for Swift project authors +]] + +add_library(SWBBuildSystem + BuildManager.swift + BuildOperation.swift + BuildOperationExtension.swift + BuildSystemCache.swift + CleanOperation.swift + DependencyCycleFormatter.swift + SandboxViolations.swift) +set_target_properties(SWBBuildSystem PROPERTIES + Swift_LANGUAGE_VERSION 5) +target_link_libraries(SWBBuildSystem PUBLIC + SWBCore + SWBTaskConstruction + SWBTaskExecution) diff --git a/Sources/SWBCAS/CMakeLists.txt b/Sources/SWBCAS/CMakeLists.txt new file mode 100644 index 00000000..b35d440e --- /dev/null +++ b/Sources/SWBCAS/CMakeLists.txt @@ -0,0 +1,21 @@ +#[[ +This source file is part of the Swift open source project + +Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors +Licensed under Apache License v2.0 with Runtime Library Exception + +See http://swift.org/LICENSE.txt for license information +See http://swift.org/CONTRIBUTORS.txt for Swift project authors +]] + +add_library(SWBCAS + CASFSNode.swift + CASProtocol.swift + Errors.swift + plugin_api_t.swift + ToolchainCASPlugin.swift) +set_target_properties(SWBCAS PROPERTIES + Swift_LANGUAGE_VERSION 6) +target_link_libraries(SWBCAS PUBLIC + SWBUtil + SWBCSupport) diff --git a/Sources/SWBCLibc/CMakeLists.txt b/Sources/SWBCLibc/CMakeLists.txt new file mode 100644 index 00000000..a5d690b0 --- /dev/null +++ b/Sources/SWBCLibc/CMakeLists.txt @@ -0,0 +1,14 @@ +#[[ +This source file is part of the Swift open source project + +Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors +Licensed under Apache License v2.0 with Runtime Library Exception + +See http://swift.org/LICENSE.txt for license information +See http://swift.org/CONTRIBUTORS.txt for Swift project authors +]] + +add_library(SWBCLibc + libc.c) +target_include_directories(SWBCLibc INTERFACE + include) diff --git a/Sources/SWBCSupport/CMakeLists.txt b/Sources/SWBCSupport/CMakeLists.txt new file mode 100644 index 00000000..be685aeb --- /dev/null +++ b/Sources/SWBCSupport/CMakeLists.txt @@ -0,0 +1,23 @@ +#[[ +This source file is part of the Swift open source project + +Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors +Licensed under Apache License v2.0 with Runtime Library Exception + +See http://swift.org/LICENSE.txt for license information +See http://swift.org/CONTRIBUTORS.txt for Swift project authors +]] + +add_library(SWBCSupport STATIC + CLibclang.cpp + CLibRemarksHelper.c) +target_compile_definitions(SWBCSupport PRIVATE + $<$:_CRT_SECURE_NO_WARNINGS> + $<$:_CRT_NONSTDC_NO_WARNINGS>) +target_compile_options(SWBCSupport PRIVATE + -fblocks) +target_include_directories(SWBCSupport PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR}) +# TODO(compnerd) wire this up with `find_package` +target_link_libraries(SWBCSupport PRIVATE + BlocksRuntime) diff --git a/Sources/SWBCSupport/module.modulemap b/Sources/SWBCSupport/module.modulemap new file mode 100644 index 00000000..7aef298c --- /dev/null +++ b/Sources/SWBCSupport/module.modulemap @@ -0,0 +1,4 @@ +module SWBCSupport { + header "SWBCSupport.h" + export * +} diff --git a/Sources/SWBCore/CMakeLists.txt b/Sources/SWBCore/CMakeLists.txt new file mode 100644 index 00000000..0f0f9c84 --- /dev/null +++ b/Sources/SWBCore/CMakeLists.txt @@ -0,0 +1,188 @@ +#[[ +This source file is part of the Swift open source project + +Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors +Licensed under Apache License v2.0 with Runtime Library Exception + +See http://swift.org/LICENSE.txt for license information +See http://swift.org/CONTRIBUTORS.txt for Swift project authors +]] + +add_library(SWBCore + ActivityReporting.swift + Apple/DeviceFamily.swift + Apple/InterfaceBuilderShared.swift + BuildFileFilteringContext.swift + BuildFileResolution.swift + BuildParameters.swift + BuildRequest.swift + BuildRequestContext.swift + BuildRuleAction.swift + BuildRuleCondition.swift + BuildRuleSet.swift + CapturedBuildInfo.swift + ClangModuleVerifier/ModuleVerifierFilenameMap.swift + ClangModuleVerifier/ModuleVerifierFramework.swift + ClangModuleVerifier/ModuleVerifierHeader.swift + ClangModuleVerifier/ModuleVerifierLanguage.swift + ClangModuleVerifier/ModuleVerifierModuleMap.swift + ClangModuleVerifier/ModuleVerifierModuleMapFileVerifier.swift + ClangModuleVerifier/ModuleVerifierTarget.swift + ClangModuleVerifierOutputParser.swift + ClangSerializedDiagnostics.swift + CommandLineArgument.swift + ConfiguredTarget.swift + Core.swift + CustomTaskTypeDescription.swift + DependencyInfoEditPayload.swift + DependencyResolution.swift + DiagnosticSupport.swift + EnvironmentBindings.swift + ExecutableTask.swift + Extensions/DiagnosticToolingExtension.swift + Extensions/EnvironmentExtension.swift + Extensions/FeatureAvailabilityExtension.swift + Extensions/InputFileGroupingStrategyExtension.swift + Extensions/PlatformInfoExtension.swift + Extensions/SDKRegistryExtension.swift + Extensions/SDKVariantInfoExtension.swift + Extensions/SettingsBuilderExtension.swift + Extensions/SpecificationsExtension.swift + Extensions/ToolchainRegistryExtension.swift + FileSystemSignatureBasedCache.swift + FileToBuild.swift + KnownFolders.swift + LibclangVendored/ArrayExtensions.swift + LibclangVendored/CStringArray.swift + LibclangVendored/Libclang.swift + LibSwiftDriver/LibSwiftDriver.swift + LibSwiftDriver/PlannedBuild.swift + LinkageDependencyResolver.swift + MacCatalystInfo.swift + MacroConfigFileLoader.swift + MacroEvaluationExtensions.swift + MacroExpressionSourceExtensions.swift + MissingFrameworkDiagnostics.swift + OnDemandResources.swift + OptimizationRemarks.swift + PlannedNode.swift + PlannedTask.swift + PlannedTaskAction.swift + PlatformEnvironment.swift + PlatformFiltering.swift + PlatformRegistry.swift + Process.swift + ProcessExecutionCache.swift + ProductTypeIdentifier.swift + ProjectModel/BuildConfiguration.swift + ProjectModel/BuildFile.swift + ProjectModel/BuildPhase.swift + ProjectModel/BuildRule.swift + ProjectModel/DependencyInfoFormat.swift + ProjectModel/FilePathResolver.swift + ProjectModel/FileTextEncoding.swift + ProjectModel/ImpartedBuildProperties.swift + ProjectModel/PIFLoader.swift + ProjectModel/PlatformFilter.swift + ProjectModel/Project.swift + ProjectModel/ProjectModelItem.swift + ProjectModel/Reference.swift + ProjectModel/ReferenceLookupContext.swift + ProjectModel/Target.swift + ProjectModel/Workspace.swift + ProjectModel/WorkspaceHeaderIndex.swift + ProvisionalTask.swift + Provisioning.swift + ProvisioningTaskInputs.swift + SDKRegistry.swift + Settings/BuildRuleFile.swift + Settings/BuiltinMacros.swift + Settings/CASOptions.swift + Settings/RecursiveSearchPathResolver.swift + Settings/Settings.swift + Settings/StackedSearchPaths.swift + ShellScript.swift + SigningSupport.swift + Specs/CommandLineToolSpec.swift + Specs/CompilerSpec.swift + Specs/CoreBuildSystem.xcspec + Specs/ExternalBuildSystem.xcspec + Specs/FileTypes.swift + Specs/LinkerSpec.swift + Specs/NativeBuildSystem.xcspec + Specs/ProductTypes.swift + Specs/PropertyDomainSpec.swift + Specs/RegisterSpecs.swift + Specs/SpecParser.swift + Specs/SpecRegistry.swift + Specs/Specs.swift + Specs/Tools/AppIntentsMetadataCompiler.swift + Specs/Tools/AppIntentsSSUTrainingCompiler.swift + Specs/Tools/AppShortcutStringsMetadataCompiler.swift + Specs/Tools/CCompiler.swift + Specs/Tools/ClangModuleVerifierInputGenerator.swift + Specs/Tools/ClangStatCache.swift + Specs/Tools/CodeSign.swift + Specs/Tools/ConcatenateTool.swift + Specs/Tools/ConstructStubExecutorFileListTool.swift + Specs/Tools/CopyTool.swift + Specs/Tools/CreateAssetPackManifestTool.swift + Specs/Tools/CreateBuildDirectory.swift + Specs/Tools/DocumentationCompiler.swift + Specs/Tools/DsymutilTool.swift + Specs/Tools/Gate.swift + Specs/Tools/GCCCompatibleCompilerSupport.swift + Specs/Tools/GenerateAppPlaygroundAssetCatalog.swift + Specs/Tools/InfoPlistTool.swift + Specs/Tools/LaunchServicesRegisterTool.swift + Specs/Tools/LinkerTools.swift + Specs/Tools/Lipo.swift + Specs/Tools/MasterObjectLink.swift + Specs/Tools/MergeInfoPlist.swift + Specs/Tools/MkdirTool.swift + Specs/Tools/ModulesVerifierTool.swift + Specs/Tools/PLUtilTool.swift + Specs/Tools/ProcessXCFrameworkLibrary.swift + Specs/Tools/ProductPackaging.swift + Specs/Tools/RegisterExecutionPolicyException.swift + Specs/Tools/SetAttributes.swift + Specs/Tools/ShellScriptTool.swift + Specs/Tools/SignatureCollection.swift + Specs/Tools/StripTool.swift + Specs/Tools/SwiftABICheckerTool.swift + Specs/Tools/SwiftABIGenerationTool.swift + Specs/Tools/SwiftCompiler.swift + Specs/Tools/SwiftHeaderTool.swift + Specs/Tools/SwiftStdLibTool.swift + Specs/Tools/SwiftSymbolExtractor.swift + Specs/Tools/SymlinkTool.swift + Specs/Tools/TAPISymbolExtractor.swift + Specs/Tools/TAPITools.swift + Specs/Tools/TiffUtilTool.swift + Specs/Tools/TouchTool.swift + Specs/Tools/UnifdefTool.swift + Specs/Tools/ValidateDevelopmentAssets.swift + Specs/Tools/ValidateEmbeddedBinaryTool.swift + Specs/Tools/ValidateProductTool.swift + Specs/Tools/WriteFile.swift + SWBFeatureFlag.swift + TargetDependencyResolver.swift + TargetPlatformDiagnostics.swift + TaskGeneration.swift + TaskResult.swift + ToolchainRegistry.swift + ToolInfo/ClangToolInfo.swift + Tuning.swift + WorkspaceContext.swift + WorkspaceSettingsCache.swift + XCFramework.swift) +set_target_properties(SWBCore PROPERTIES + Swift_LANGUAGE_VERSION 5) +target_link_libraries(SWBCore PUBLIC + SWBMacro + SWBProtocol + SWBServiceCore + SWBUtil + SWBCAS + SWBLLBuild + SwiftDriver) diff --git a/Sources/SWBLLBuild/CMakeLists.txt b/Sources/SWBLLBuild/CMakeLists.txt new file mode 100644 index 00000000..3f36654b --- /dev/null +++ b/Sources/SWBLLBuild/CMakeLists.txt @@ -0,0 +1,18 @@ +#[[ +This source file is part of the Swift open source project + +Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors +Licensed under Apache License v2.0 with Runtime Library Exception + +See http://swift.org/LICENSE.txt for license information +See http://swift.org/CONTRIBUTORS.txt for Swift project authors +]] + +add_library(SWBLLBuild + LowLevelBuildSystem.swift) +set_target_properties(SWBLLBuild PROPERTIES + Swift_LANGUAGE_VERSION 6) +target_link_libraries(SWBLLBuild PUBLIC + SWBUtil + $<$>:libllbuild> + $<$>:llbuildSwift>) diff --git a/Sources/SWBLibc/CMakeLists.txt b/Sources/SWBLibc/CMakeLists.txt new file mode 100644 index 00000000..8e5daf61 --- /dev/null +++ b/Sources/SWBLibc/CMakeLists.txt @@ -0,0 +1,21 @@ +#[[ +This source file is part of the Swift open source project + +Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors +Licensed under Apache License v2.0 with Runtime Library Exception + +See http://swift.org/LICENSE.txt for license information +See http://swift.org/CONTRIBUTORS.txt for Swift project authors +]] + +add_library(SWBLibc + libc.swift) +set_target_properties(SWBLibc PROPERTIES + Swift_LANGUAGE_VERSION 6) +target_link_libraries(SWBLibc PUBLIC + SWBCLibc) + +# FIXME: why is this needed? We should be wiring up the Swift_MODULE_DIRECTORY +# without this explicit configuration. +target_include_directories(SWBLibc PUBLIC + ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/Sources/SWBMacro/CMakeLists.txt b/Sources/SWBMacro/CMakeLists.txt new file mode 100644 index 00000000..4abeddf1 --- /dev/null +++ b/Sources/SWBMacro/CMakeLists.txt @@ -0,0 +1,35 @@ +#[[ +This source file is part of the Swift open source project + +Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors +Licensed under Apache License v2.0 with Runtime Library Exception + +See http://swift.org/LICENSE.txt for license information +See http://swift.org/CONTRIBUTORS.txt for Swift project authors +]] + +add_library(SWBMacro + MacroCondition.swift + MacroConditionExpression.swift + MacroConditionParameter.swift + MacroConditionSet.swift + MacroConfigFileDiagnostic.swift + MacroConfigFileParser.swift + MacroDeclaration.swift + MacroEvaluationProgram.swift + MacroEvaluationScope.swift + MacroExpression.swift + MacroExpressionDiagnostic.swift + MacroExpressionParsing.swift + MacroNamespace.swift + MacroType.swift + MacroValueAssignmentTable.swift) +set_target_properties(SWBMacro PROPERTIES + Swift_LANGUAGE_VERSION 6) +target_link_libraries(SWBMacro PUBLIC + SWBUtil + SwiftDriver + TSCBasic) + +target_include_directories(SWBMacro PUBLIC + ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/Sources/SWBProjectModel/CMakeLists.txt b/Sources/SWBProjectModel/CMakeLists.txt new file mode 100644 index 00000000..3a98c919 --- /dev/null +++ b/Sources/SWBProjectModel/CMakeLists.txt @@ -0,0 +1,22 @@ +#[[ +This source file is part of the Swift open source project + +Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors +Licensed under Apache License v2.0 with Runtime Library Exception + +See http://swift.org/LICENSE.txt for license information +See http://swift.org/CONTRIBUTORS.txt for Swift project authors +]] + +add_library(SWBProjectModel + IDE/IDEPIFGenerating.swift + IDE/IDEPIFGUID.swift + IDE/IDEPIFObject.swift + IDE/IDEPIFObjectInfo.swift + IDE/IDEPIFSerializer.swift + IDE/IDESwiftPackageExtensions.swift + PIFGenerationModel.swift) +set_target_properties(SWBProjectModel PROPERTIES + Swift_LANGUAGE_VERSION 6) +target_link_libraries(SWBProjectModel PUBLIC + SWBProtocol) diff --git a/Sources/SWBProtocol/CMakeLists.txt b/Sources/SWBProtocol/CMakeLists.txt new file mode 100644 index 00000000..d00c636b --- /dev/null +++ b/Sources/SWBProtocol/CMakeLists.txt @@ -0,0 +1,50 @@ +#[[ +This source file is part of the Swift open source project + +Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors +Licensed under Apache License v2.0 with Runtime Library Exception + +See http://swift.org/LICENSE.txt for license information +See http://swift.org/CONTRIBUTORS.txt for Swift project authors +]] + +add_library(SWBProtocol + AsyncSequence.swift + BuildAction.swift + BuildOperationMessages.swift + BuildSettingsInfoMessageTypes.swift + ClientExchangeMessages.swift + DependencyClosureMessages.swift + DependencyGraphMessages.swift + DocumentationMessages.swift + IndexingMessages.swift + LocalizationMessages.swift + MacroEvaluationMessages.swift + Message.swift + MessageSupport.swift + PIFKeyConstants.swift + PlanningOperationMessages.swift + PreviewMessages.swift + ProjectDescriptorMessages.swift + ProjectDescriptorTypes.swift + ProjectModel/BuildConfiguration.swift + ProjectModel/BuildFile.swift + ProjectModel/BuildPhase.swift + ProjectModel/BuildRule.swift + ProjectModel/CustomTask.swift + ProjectModel/DependencyInfo.swift + ProjectModel/ImpartedBuildProperties.swift + ProjectModel/MacroExpressionSource.swift + ProjectModel/PIFObject.swift + ProjectModel/PlatformFilter.swift + ProjectModel/Project.swift + ProjectModel/ProvisioningSourceData.swift + ProjectModel/Reference.swift + ProjectModel/SourceTree.swift + ProjectModel/Target.swift + ProjectModel/TargetDependency.swift + ProjectModel/Workspace.swift) +set_target_properties(SWBProtocol PROPERTIES + Swift_LANGUAGE_VERSION 6) +target_link_libraries(SWBProtocol PUBLIC + SWBUtil) diff --git a/Sources/SWBServiceCore/CMakeLists.txt b/Sources/SWBServiceCore/CMakeLists.txt new file mode 100644 index 00000000..673eec1e --- /dev/null +++ b/Sources/SWBServiceCore/CMakeLists.txt @@ -0,0 +1,20 @@ +#[[ +This source file is part of the Swift open source project + +Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors +Licensed under Apache License v2.0 with Runtime Library Exception + +See http://swift.org/LICENSE.txt for license information +See http://swift.org/CONTRIBUTORS.txt for Swift project authors +]] + +add_library(SWBServiceCore + Request.swift + Service.swift + ServiceEntryPoint.swift + ServiceExtensionPoint.swift + ServiceHostConnection.swift) +set_target_properties(SWBServiceCore PROPERTIES + Swift_LANGUAGE_VERSION 6) +target_link_libraries(SWBServiceCore PUBLIC + SWBProtocol) diff --git a/Sources/SWBTaskConstruction/CMakeLists.txt b/Sources/SWBTaskConstruction/CMakeLists.txt new file mode 100644 index 00000000..f4227f1f --- /dev/null +++ b/Sources/SWBTaskConstruction/CMakeLists.txt @@ -0,0 +1,66 @@ +#[[ +This source file is part of the Swift open source project + +Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors +Licensed under Apache License v2.0 with Runtime Library Exception + +See http://swift.org/LICENSE.txt for license information +See http://swift.org/CONTRIBUTORS.txt for Swift project authors +]] + +add_library(SWBTaskConstruction + BuildDirectoryContext.swift + DiagnosticSupport.swift + ProductPlanning/BuildPlan.swift + ProductPlanning/BuildPlanDumping.swift + ProductPlanning/ProductPlan.swift + ProductPlanning/ProductPlanner.swift + StaleFileRemovalContext.swift + TaskPlanningDelegate.swift + TaskProducers/BuildPhaseTaskProducers/AppleScriptTaskProducer.swift + TaskProducers/BuildPhaseTaskProducers/BuildRuleTaskProducer.swift + TaskProducers/BuildPhaseTaskProducers/CopyFilesTaskProducer.swift + TaskProducers/BuildPhaseTaskProducers/FilesBasedBuildPhaseTaskProducer.swift + TaskProducers/BuildPhaseTaskProducers/HeadersTaskProducer.swift + TaskProducers/BuildPhaseTaskProducers/ResourcesTaskProducer.swift + TaskProducers/BuildPhaseTaskProducers/RezTaskProducer.swift + TaskProducers/BuildPhaseTaskProducers/ShellBasedTaskProducer.swift + TaskProducers/BuildPhaseTaskProducers/ShellScriptTaskProducer.swift + TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift + TaskProducers/BuildPhaseTaskProducers/SwiftPackageCopyFilesTaskProducer.swift + TaskProducers/OtherTaskProducers/AppIntentsMetadataTaskProducer.swift + TaskProducers/OtherTaskProducers/CopySwiftPackageResourcesTaskProducer.swift + TaskProducers/OtherTaskProducers/CustomTaskProducer.swift + TaskProducers/OtherTaskProducers/DevelopmentAssetsTaskProducer.swift + TaskProducers/OtherTaskProducers/DocumentationTaskProducer.swift + TaskProducers/OtherTaskProducers/ExternalTargetTaskProducer.swift + TaskProducers/OtherTaskProducers/GenerateAppPlaygroundAssetCatalogTaskProducer.swift + TaskProducers/OtherTaskProducers/GeneratedFilesTaskProducer.swift + TaskProducers/OtherTaskProducers/HeadermapTaskProducer.swift + TaskProducers/OtherTaskProducers/InfoPlistTaskProducer.swift + TaskProducers/OtherTaskProducers/ModuleMapTaskProducer.swift + TaskProducers/OtherTaskProducers/ModuleVerifierTaskProducer.swift + TaskProducers/OtherTaskProducers/ProductPostprocessingTaskProducer.swift + TaskProducers/OtherTaskProducers/ProductStructureTaskProducer.swift + TaskProducers/OtherTaskProducers/SanitizerTaskProducer.swift + TaskProducers/OtherTaskProducers/SDKStatCacheTaskProducer.swift + TaskProducers/OtherTaskProducers/SwiftFrameworkABICheckerTaskProducer.swift + TaskProducers/OtherTaskProducers/SwiftStandardLibrariesTaskProducer.swift + TaskProducers/OtherTaskProducers/TAPISymbolExtractorTaskProducer.swift + TaskProducers/OtherTaskProducers/TargetOrderTaskProducer.swift + TaskProducers/OtherTaskProducers/XCTestProductTypeTaskProducer.swift + TaskProducers/StandardTaskProducer.swift + TaskProducers/TaskProducer.swift + TaskProducers/TaskProducerExtensionPoint.swift + TaskProducers/WorkspaceTaskProducers/CreateBuildDirectoryTaskProducer.swift + TaskProducers/WorkspaceTaskProducers/HeadermapVFSTaskProducer.swift + TaskProducers/WorkspaceTaskProducers/IndexBuildVFSDirectoryRemapTaskProducer.swift + TaskProducers/WorkspaceTaskProducers/PCHModuleMapTaskProducer.swift + TaskProducers/WorkspaceTaskProducers/XCFrameworkTaskProducer.swift + TaskProducerSandboxing.swift + XCFrameworkContext.swift) +set_target_properties(SWBTaskConstruction PROPERTIES + Swift_LANGUAGE_VERSION 5) +target_link_libraries(SWBTaskConstruction PUBLIC + SWBCore + SWBUtil) diff --git a/Sources/SWBTaskExecution/CMakeLists.txt b/Sources/SWBTaskExecution/CMakeLists.txt new file mode 100644 index 00000000..5873ceb7 --- /dev/null +++ b/Sources/SWBTaskExecution/CMakeLists.txt @@ -0,0 +1,81 @@ +#[[ +This source file is part of the Swift open source project + +Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors +Licensed under Apache License v2.0 with Runtime Library Exception + +See http://swift.org/LICENSE.txt for license information +See http://swift.org/CONTRIBUTORS.txt for Swift project authors +]] + +add_library(SWBTaskExecution + BuildDescription.swift + BuildDescriptionManager.swift + BuildDescriptionSignature.swift + DynamicTaskSpecs/ClangCachingKeyQueryDynamicTaskSpec.swift + DynamicTaskSpecs/ClangCachingMaterializeKeyDynamicTaskSpec.swift + DynamicTaskSpecs/ClangCachingOutputMaterializerDynamicTaskSpec.swift + DynamicTaskSpecs/ClangCachingTaskCacheKey.swift + DynamicTaskSpecs/ClangModuleDependencyGraph.swift + DynamicTaskSpecs/CompilationCachingDataPruner.swift + DynamicTaskSpecs/CompilationCachingUploader.swift + DynamicTaskSpecs/DynamicTaskOperationContext.swift + DynamicTaskSpecs/DynamicTaskSpecRegistry.swift + DynamicTaskSpecs/PrecompileClangModuleDynamicTaskSpec.swift + DynamicTaskSpecs/SwiftCachingDynamicTaskSpec.swift + DynamicTaskSpecs/SwiftCachingTaskKeys.swift + DynamicTaskSpecs/SwiftDriverJobDynamicTaskSpec.swift + DynamicTaskSpecs/SwiftDriverPlanningDynamicTaskSpec.swift + ProjectPlanner.swift + Task.swift + TaskActions/AuxiliaryFileTaskAction.swift + TaskActions/ClangCachingKeyQueryTaskAction.swift + TaskActions/ClangCachingMaterializeKeyTaskAction.swift + TaskActions/ClangCachingOutputMaterializerTaskAction.swift + TaskActions/ClangCompileTaskAction.swift + TaskActions/ClangModuleVerifierInputGeneratorTaskAction.swift + TaskActions/ClangScanTaskAction.swift + TaskActions/CodeSignTaskAction.swift + TaskActions/ConcatenateTaskAction.swift + TaskActions/ConstructStubExecutorInputFileListTaskAction.swift + TaskActions/CopyPlistTaskAction.swift + TaskActions/CopyStringsFileTaskAction.swift + TaskActions/CopyTiffTaskAction.swift + TaskActions/CreateBuildDirectoryTaskAction.swift + TaskActions/DeferredExecutionTaskAction.swift + TaskActions/EmbedSwiftStdLibTaskAction.swift + TaskActions/FileCopyTaskAction.swift + TaskActions/GenericCachingTaskAction.swift + TaskActions/InfoPlistProcessorTaskAction.swift + TaskActions/LinkAssetCatalogTaskAction.swift + TaskActions/LSRegisterURLTaskAction.swift + TaskActions/MergeInfoPlistTaskAction.swift + TaskActions/ODRAssetPackManifestTaskAction.swift + TaskActions/PrecompileClangModuleTaskAction.swift + TaskActions/ProcessProductEntitlementsTaskAction.swift + TaskActions/ProcessProductProvisioningProfileTaskAction.swift + TaskActions/ProcessXCFrameworkTaskAction.swift + TaskActions/RegisterExecutionPolicyExceptionTaskAction.swift + TaskActions/SignatureCollectionTaskAction.swift + TaskActions/SwiftCachingKeyQueryTaskAction.swift + TaskActions/SwiftCachingMaterializeKeyTaskAction.swift + TaskActions/SwiftCachingOutputMaterializerTaskAction.swift + TaskActions/SwiftCompilationTaskAction.swift + TaskActions/SwiftDriverCompilationRequirementTaskAction.swift + TaskActions/SwiftDriverJobSchedulingTaskAction.swift + TaskActions/SwiftDriverJobTaskAction.swift + TaskActions/SwiftDriverTaskAction.swift + TaskActions/SwiftHeaderToolTaskAction.swift + TaskActions/TaskAction.swift + TaskActions/ValidateDevelopmentAssetsTaskAction.swift + TaskActions/ValidateProductTaskAction.swift + TaskResult.swift + TaskStore.swift) +set_target_properties(SWBTaskExecution PROPERTIES + Swift_LANGUAGE_VERSION 5) +target_link_libraries(SWBTaskExecution PUBLIC + SWBCAS + SWBCore + SWBLLBuild + SWBTaskConstruction + SWBUtil) diff --git a/Sources/SWBUtil/CMakeLists.txt b/Sources/SWBUtil/CMakeLists.txt new file mode 100644 index 00000000..e25ff5b3 --- /dev/null +++ b/Sources/SWBUtil/CMakeLists.txt @@ -0,0 +1,111 @@ +#[[ +This source file is part of the Swift open source project + +Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors +Licensed under Apache License v2.0 with Runtime Library Exception + +See http://swift.org/LICENSE.txt for license information +See http://swift.org/CONTRIBUTORS.txt for Swift project authors +]] + +add_library(SWBUtil + Architecture.swift + ArgumentSplitting.swift + Array.swift + AsyncCache.swift + AsyncFlatteningSequence.swift + AsyncIteratorProtocol.swift + AsyncLock.swift + AsyncOperationQueue.swift + AsyncSingleValueCache.swift + AsyncStreamController.swift + ByteString.swift + Cache.swift + Collection.swift + CountedSet.swift + CSV.swift + Debugger.swift + DependencyInfo.swift + DiagnosticsEngine.swift + Dictionary.swift + Diff.swift + Dispatch+Async.swift + Duration.swift + ElapsedTimer.swift + EmptyState.swift + Environment.swift + Error.swift + FileHandle+Async.swift + FilesSignature.swift + fnmatch.swift + FSProxy.swift + GraphAlgorithms.swift + HashContext.swift + Headermap.swift + HeavyCache.swift + Int.swift + InterningArena.swift + IO.swift + JSONEncoder.swift + KeyValueStorage.swift + LazyCache.swift + Library.swift + LineReader.swift + Lock.swift + MachO.swift + Math.swift + Misc+Async.swift + Misc.swift + MsgPack.swift + MsgPackSerialization.swift + NamedTemporaryDirectory.swift + Optional.swift + OrderedDictionary.swift + OrderedSet.swift + OSLog.swift + OutputByteStream.swift + Pair.swift + Path.swift + PbxCp.swift + PluginManager.swift + PluginManagerCommon.swift + POSIX.swift + Process+Async.swift + Process.swift + ProcessInfo.swift + Promise.swift + PropertyList.swift + Queue.swift + RateLimiter.swift + Ref.swift + RegEx.swift + Registry.swift + ResponseFiles.swift + Result.swift + ScopedKeepAliveCache.swift + Serialization.swift + Signatures.swift + Static.swift + Statistics.swift + String.swift + SWBDispatch.swift + TAPIFileList.swift + TBDFile.swift + UniqueSerialization.swift + UnsafeSendableDelayedInitializationWrapper.swift + URL.swift + UserDefaults.swift + Version.swift + VFS.swift + WaitCondition.swift + WeakRef.swift + XCBuildDataArchive.swift + Xcode.swift) +set_target_properties(SWBUtil PROPERTIES + Swift_LANGUAGE_VERSION 5) +target_link_libraries(SWBUtil PUBLIC + SWBCSupport + SWBLibc + ArgumentParser + $<$>:Crypto::Crypto> + SwiftSystem::SystemPackage) diff --git a/Sources/SwiftBuild/CMakeLists.txt b/Sources/SwiftBuild/CMakeLists.txt new file mode 100644 index 00000000..2ccf3232 --- /dev/null +++ b/Sources/SwiftBuild/CMakeLists.txt @@ -0,0 +1,69 @@ +#[[ +This source file is part of the Swift open source project + +Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors +Licensed under Apache License v2.0 with Runtime Library Exception + +See http://swift.org/LICENSE.txt for license information +See http://swift.org/CONTRIBUTORS.txt for Swift project authors +]] + +add_library(SwiftBuild + CompatibilityShims.swift + ConsoleCommands/SWBServiceConsoleBuildCommand.swift + ConsoleCommands/SWBServiceConsoleBuildCommandProtocol.swift + ConsoleCommands/SWBServiceConsoleCreateXCFrameworkCommand.swift + ConsoleCommands/SWBServiceConsoleGeneralCommands.swift + ConsoleCommands/SWBServiceConsoleSessionCommands.swift + ConsoleCommands/SWBServiceConsoleXcodeCommands.swift + ProjectModel/BuildConfig.swift + ProjectModel/BuildFile.swift + ProjectModel/BuildPhases.swift + ProjectModel/BuildRule.swift + ProjectModel/BuildSettings.swift + ProjectModel/CustomTask.swift + ProjectModel/ImpartedBuildProperties.swift + ProjectModel/PlatformFilter.swift + ProjectModel/Project.swift + ProjectModel/ProjectModel.swift + ProjectModel/References.swift + ProjectModel/SandboxingOverride.swift + ProjectModel/TargetDependency.swift + ProjectModel/Targets.swift + SWBBuildAction.swift + SWBBuildOperation.swift + SWBBuildOperationBacktraceFrame.swift + SWBBuildParameters.swift + SWBBuildRequest.swift + SWBBuildService.swift + SWBBuildServiceConnection.swift + SWBBuildServiceConsole.swift + SWBBuildServiceSession.swift + SWBChannel.swift + SWBClientExchangeSupport.swift + SWBDocumentationSupport.swift + SWBIndexingSupport.swift + SWBLocalizationSupport.swift + SWBMacroEvaluation.swift + SWBMacroEvaluationScope.swift + SWBPreviewSupport.swift + SWBProductPlannerSupport.swift + SWBPropertyList.swift + SWBProvisioningTaskInputs.swift + SWBSystemInfo.swift + SWBTargetGUID.swift + SWBTerminal.swift + SWBuildMessage+Protocol.swift + SWBUserInfo.swift + SWBWorkspaceInfo.swift + SwiftBuild.swift + SwiftBuildVersion.swift + TerminalAttributes.swift) +set_target_properties(SwiftBuild PROPERTIES + Swift_LANGUAGE_VERSION 5) +target_link_libraries(SwiftBuild PUBLIC + SWBCSupport + SWBCore + SWBProtocol + SWBUtil + SWBProjectModel) diff --git a/Sources/swbuild/CMakeLists.txt b/Sources/swbuild/CMakeLists.txt new file mode 100644 index 00000000..04fb8b7c --- /dev/null +++ b/Sources/swbuild/CMakeLists.txt @@ -0,0 +1,20 @@ +#[[ +This source file is part of the Swift open source project + +Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors +Licensed under Apache License v2.0 with Runtime Library Exception + +See http://swift.org/LICENSE.txt for license information +See http://swift.org/CONTRIBUTORS.txt for Swift project authors +]] + +add_executable(swbuild + SWBuildMain.swift) +set_target_properties(swbuild PROPERTIES + Swift_LANGUAGE_VERSION 6) +target_compile_options(swbuild PRIVATE + -parse-as-library) +target_link_libraries(swbuild PRIVATE + SwiftBuild) + +install(TARGETS swbuild)