summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2022-04-28 12:05:05 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2022-07-06 14:15:23 (GMT)
commitfddd44c897761f474f6b58321a5b8a988b2f16da (patch)
treeb5db1d43270a77cb08ce7d9fb48aef6cac2a4509 /Source
parent95402a0bd7e226d7b02f8620c237b15d9c4326ab (diff)
downloadCMake-fddd44c897761f474f6b58321a5b8a988b2f16da.zip
CMake-fddd44c897761f474f6b58321a5b8a988b2f16da.tar.gz
CMake-fddd44c897761f474f6b58321a5b8a988b2f16da.tar.bz2
cmNinjaTargetGenerator: write out BMI install information for the collator
Diffstat (limited to 'Source')
-rw-r--r--Source/cmNinjaTargetGenerator.cxx38
1 files changed, 38 insertions, 0 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index ce4248c..86ae45d 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -28,6 +28,7 @@
#include "cmGeneratorExpression.h"
#include "cmGeneratorTarget.h"
#include "cmGlobalNinjaGenerator.h"
+#include "cmInstallCxxModuleBmiGenerator.h"
#include "cmInstallExportGenerator.h"
#include "cmInstallFileSetGenerator.h"
#include "cmInstallGenerator.h"
@@ -1763,6 +1764,43 @@ void cmNinjaTargetGenerator::WriteTargetDependInfo(std::string const& lang,
Json::Value& tdi_exports = tdi["exports"] = Json::arrayValue;
std::string export_name = this->GeneratorTarget->GetExportName();
+ cmInstallCxxModuleBmiGenerator const* bmi_gen = nullptr;
+ for (auto const& ig : this->GetMakefile()->GetInstallGenerators()) {
+ if (auto const* bmig =
+ dynamic_cast<cmInstallCxxModuleBmiGenerator const*>(ig.get())) {
+ if (bmig->GetTarget() == this->GeneratorTarget) {
+ bmi_gen = bmig;
+ continue;
+ }
+ }
+ }
+ if (bmi_gen) {
+ Json::Value tdi_bmi_info = Json::objectValue;
+
+ tdi_bmi_info["permissions"] = bmi_gen->GetFilePermissions();
+ tdi_bmi_info["destination"] = bmi_gen->GetDestination(config);
+ const char* msg_level = "";
+ switch (bmi_gen->GetMessageLevel()) {
+ case cmInstallGenerator::MessageDefault:
+ break;
+ case cmInstallGenerator::MessageAlways:
+ msg_level = "MESSAGE_ALWAYS";
+ break;
+ case cmInstallGenerator::MessageLazy:
+ msg_level = "MESSAGE_LAZY";
+ break;
+ case cmInstallGenerator::MessageNever:
+ msg_level = "MESSAGE_NEVER";
+ break;
+ }
+ tdi_bmi_info["message-level"] = msg_level;
+ tdi_bmi_info["script-location"] = bmi_gen->GetScriptLocation(config);
+
+ tdi["bmi-installation"] = tdi_bmi_info;
+ } else {
+ tdi["bmi-installation"] = Json::nullValue;
+ }
+
auto const& all_install_exports =
this->GetGlobalGenerator()->GetExportSets();
for (auto const& exp : all_install_exports) {