mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-05 21:31:08 -06:00
Merge branch 'backport-swift-ninja-multiconfig' into swift-ninja-multiconfig
This commit is contained in:
@@ -16,7 +16,7 @@ if("${CMAKE_GENERATOR}" STREQUAL "Xcode")
|
|||||||
endif()
|
endif()
|
||||||
set(CMAKE_Swift_COMPILER_XCODE_TYPE sourcecode.swift)
|
set(CMAKE_Swift_COMPILER_XCODE_TYPE sourcecode.swift)
|
||||||
_cmake_find_compiler_path(Swift)
|
_cmake_find_compiler_path(Swift)
|
||||||
elseif("${CMAKE_GENERATOR}" STREQUAL "Ninja")
|
elseif("${CMAKE_GENERATOR}" MATCHES "^Ninja")
|
||||||
if(CMAKE_Swift_COMPILER)
|
if(CMAKE_Swift_COMPILER)
|
||||||
_cmake_find_compiler_path(Swift)
|
_cmake_find_compiler_path(Swift)
|
||||||
else()
|
else()
|
||||||
|
|||||||
@@ -885,11 +885,11 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement(
|
|||||||
cmOutputConverter::SHELL);
|
cmOutputConverter::SHELL);
|
||||||
}(vars["SWIFT_MODULE_NAME"]);
|
}(vars["SWIFT_MODULE_NAME"]);
|
||||||
|
|
||||||
|
const std::string map = cmStrCat(gt->GetSupportDirectory(), '/', config,
|
||||||
|
'/', "output-file-map.json");
|
||||||
vars["SWIFT_OUTPUT_FILE_MAP"] =
|
vars["SWIFT_OUTPUT_FILE_MAP"] =
|
||||||
this->GetLocalGenerator()->ConvertToOutputFormat(
|
this->GetLocalGenerator()->ConvertToOutputFormat(
|
||||||
this->ConvertToNinjaPath(gt->GetSupportDirectory() +
|
this->ConvertToNinjaPath(map), cmOutputConverter::SHELL);
|
||||||
"/output-file-map.json"),
|
|
||||||
cmOutputConverter::SHELL);
|
|
||||||
|
|
||||||
vars["SWIFT_SOURCES"] = [this, config]() -> std::string {
|
vars["SWIFT_SOURCES"] = [this, config]() -> std::string {
|
||||||
std::vector<cmSourceFile const*> sources;
|
std::vector<cmSourceFile const*> sources;
|
||||||
|
|||||||
@@ -952,8 +952,9 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatements(
|
|||||||
this->GetImplFileStream(fileConfig) << "\n";
|
this->GetImplFileStream(fileConfig) << "\n";
|
||||||
|
|
||||||
if (!this->Configs[config].SwiftOutputMap.empty()) {
|
if (!this->Configs[config].SwiftOutputMap.empty()) {
|
||||||
std::string const mapFilePath = cmStrCat(
|
std::string const mapFilePath =
|
||||||
this->GeneratorTarget->GetSupportDirectory(), "/output-file-map.json");
|
cmStrCat(this->GeneratorTarget->GetSupportDirectory(), '/', config, '/',
|
||||||
|
"output-file-map.json");
|
||||||
std::string const targetSwiftDepsPath = [this, config]() -> std::string {
|
std::string const targetSwiftDepsPath = [this, config]() -> std::string {
|
||||||
cmGeneratorTarget const* target = this->GeneratorTarget;
|
cmGeneratorTarget const* target = this->GeneratorTarget;
|
||||||
if (const char* name = target->GetProperty("Swift_DEPENDENCIES_FILE")) {
|
if (const char* name = target->GetProperty("Swift_DEPENDENCIES_FILE")) {
|
||||||
|
|||||||
1
Tests/RunCMake/Swift/L.swift
Normal file
1
Tests/RunCMake/Swift/L.swift
Normal file
@@ -0,0 +1 @@
|
|||||||
|
public let ThirtyTwo: Int = 32
|
||||||
@@ -12,6 +12,12 @@ elseif(RunCMake_GENERATOR STREQUAL Ninja)
|
|||||||
run_cmake(SwiftMultiArch)
|
run_cmake(SwiftMultiArch)
|
||||||
unset(RunCMake_TEST_OPTIONS)
|
unset(RunCMake_TEST_OPTIONS)
|
||||||
endif()
|
endif()
|
||||||
|
elseif(RunCMake_GENERATOR STREQUAL "Ninja Multi-Config")
|
||||||
|
if(CMAKE_Swift_COMPILER)
|
||||||
|
set(RunCMake_TEST_OPTIONS "-DCMAKE_CONFIGURATION_TYPES=Debug\\;Release")
|
||||||
|
run_cmake(SwiftSimple)
|
||||||
|
unset(RunCMake_TEST_OPTIONS)
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
run_cmake(NotSupported)
|
run_cmake(NotSupported)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
2
Tests/RunCMake/Swift/SwiftSimple.cmake
Normal file
2
Tests/RunCMake/Swift/SwiftSimple.cmake
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
enable_language(Swift)
|
||||||
|
add_library(L L.swift)
|
||||||
Reference in New Issue
Block a user