diff options
author | Brad King <brad.king@kitware.com> | 2019-05-23 12:53:24 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-05-23 12:55:16 (GMT) |
commit | 79c6a573f4c6690914511e4e1894221a94f1b3e3 (patch) | |
tree | 519c0af1d2b0936ab223255d7d8a976eadcec23e | |
parent | d1a570f18c47bb840fc19a9979d3970fbaa7e58a (diff) | |
parent | 02c14b7fcd29a7dcedb930fe5d9138cb185493e1 (diff) | |
download | CMake-79c6a573f4c6690914511e4e1894221a94f1b3e3.zip CMake-79c6a573f4c6690914511e4e1894221a94f1b3e3.tar.gz CMake-79c6a573f4c6690914511e4e1894221a94f1b3e3.tar.bz2 |
Merge topic 'swift-flags'
02c14b7fcd Ninja,Swift: pass along DEFINES/FLAGS/INCLUDES
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3355
-rw-r--r-- | Modules/CMakeSwiftInformation.cmake | 8 | ||||
-rw-r--r-- | Source/cmNinjaNormalTargetGenerator.cxx | 11 |
2 files changed, 15 insertions, 4 deletions
diff --git a/Modules/CMakeSwiftInformation.cmake b/Modules/CMakeSwiftInformation.cmake index 64e7f99..1150498 100644 --- a/Modules/CMakeSwiftInformation.cmake +++ b/Modules/CMakeSwiftInformation.cmake @@ -35,9 +35,9 @@ endif() if(NOT CMAKE_Swift_CREATE_SHARED_LIBRARY) if(CMAKE_Swift_COMPILER_TARGET) - set(CMAKE_Swift_CREATE_SHARED_LIBRARY "${CMAKE_Swift_COMPILER} -target <CMAKE_Swift_COMPILER_TARGET> -output-file-map <SWIFT_OUTPUT_FILE_MAP> -incremental -emit-library -o <TARGET> -module-name <SWIFT_MODULE_NAME> -module-link-name <SWIFT_LIBRARY_NAME> -emit-module -emit-module-path <SWIFT_MODULE> -emit-dependencies <FLAGS> <SWIFT_SOURCES> <LINK_FLAGS> <LINK_LIBRARIES>") + set(CMAKE_Swift_CREATE_SHARED_LIBRARY "${CMAKE_Swift_COMPILER} -target <CMAKE_Swift_COMPILER_TARGET> -output-file-map <SWIFT_OUTPUT_FILE_MAP> -incremental -emit-library -o <TARGET> -module-name <SWIFT_MODULE_NAME> -module-link-name <SWIFT_LIBRARY_NAME> -emit-module -emit-module-path <SWIFT_MODULE> -emit-dependencies <DEFINES> <FLAGS> <INCLUDES> <SWIFT_SOURCES> <LINK_FLAGS> <LINK_LIBRARIES>") else() - set(CMAKE_Swift_CREATE_SHARED_LIBRARY "${CMAKE_Swift_COMPILER} -output-file-map <SWIFT_OUTPUT_FILE_MAP> -incremental -emit-library -o <TARGET> -module-name <SWIFT_MODULE_NAME> -module-link-name <SWIFT_LIBRARY_NAME> -emit-module -emit-module-path <SWIFT_MODULE> -emit-dependencies <FLAGS> <SWIFT_SOURCES> <LINK_FLAGS> <LINK_LIBRARIES>") + set(CMAKE_Swift_CREATE_SHARED_LIBRARY "${CMAKE_Swift_COMPILER} -output-file-map <SWIFT_OUTPUT_FILE_MAP> -incremental -emit-library -o <TARGET> -module-name <SWIFT_MODULE_NAME> -module-link-name <SWIFT_LIBRARY_NAME> -emit-module -emit-module-path <SWIFT_MODULE> -emit-dependencies <DEFINES> <FLAGS> <INCLUDES> <SWIFT_SOURCES> <LINK_FLAGS> <LINK_LIBRARIES>") endif() endif() @@ -47,9 +47,9 @@ endif() if(NOT CMAKE_Swift_LINK_EXECUTABLE) if(CMAKE_Swift_COMPILER_TARGET) - set(CMAKE_Swift_LINK_EXECUTABLE "${CMAKE_Swift_COMPILER} -target <CMAKE_Swift_COMPILER_TARGET> -output-file-map <SWIFT_OUTPUT_FILE_MAP> -incremental -emit-executable -o <TARGET> -emit-module -emit-module-path <SWIFT_MODULE> -emit-dependencies <FLAGS> <SWIFT_SOURCES> <LINK_FLAGS> <LINK_LIBRARIES>") + set(CMAKE_Swift_LINK_EXECUTABLE "${CMAKE_Swift_COMPILER} -target <CMAKE_Swift_COMPILER_TARGET> -output-file-map <SWIFT_OUTPUT_FILE_MAP> -incremental -emit-executable -o <TARGET> -emit-module -emit-module-path <SWIFT_MODULE> -emit-dependencies <DEFINES> <FLAGS> <INCLUDES> <SWIFT_SOURCES> <LINK_FLAGS> <LINK_LIBRARIES>") else() - set(CMAKE_Swift_LINK_EXECUTABLE "${CMAKE_Swift_COMPILER} -output-file-map <SWIFT_OUTPUT_FILE_MAP> -incremental -emit-executable -o <TARGET> -emit-module -emit-module-path <SWIFT_MODULE> -emit-dependencies <FLAGS> <SWIFT_SOURCES> <LINK_FLAGS> <LINK_LIBRARIES>") + set(CMAKE_Swift_LINK_EXECUTABLE "${CMAKE_Swift_COMPILER} -output-file-map <SWIFT_OUTPUT_FILE_MAP> -incremental -emit-executable -o <TARGET> -emit-module -emit-module-path <SWIFT_MODULE> -emit-dependencies <DEFINES> <FLAGS> <INCLUDES> <SWIFT_SOURCES> <LINK_FLAGS> <LINK_LIBRARIES>") endif() endif() diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 1221a3f..1e4d2ed 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -289,6 +289,10 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile) vars.SwiftModuleName = "$SWIFT_MODULE_NAME"; vars.SwiftOutputFileMap = "$SWIFT_OUTPUT_FILE_MAP"; vars.SwiftSources = "$SWIFT_SOURCES"; + + vars.Defines = "$DEFINES"; + vars.Flags = "$FLAGS"; + vars.Includes = "$INCLUDES"; } std::string responseFlag; @@ -840,6 +844,13 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() } return oss.str(); }(); + + // Since we do not perform object builds, compute the + // defines/flags/includes here so that they can be passed along + // appropriately. + vars["DEFINES"] = this->GetDefines("Swift"); + vars["FLAGS"] = this->GetFlags("Swift"); + vars["INCLUDES"] = this->GetIncludes("Swift"); } // Compute specific libraries to link with. |