summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-04-18 12:04:55 (GMT)
committerBrad King <brad.king@kitware.com>2018-04-18 12:09:56 (GMT)
commit3c47ac5b2571939f7d987d9f23a9969b1f67f46e (patch)
tree08821eef6da5116412e9e8952e175f7b7db98462 /Source/cmGlobalGenerator.cxx
parent12139ad009930ba00c650c03e11f4eff3a081839 (diff)
downloadCMake-3c47ac5b2571939f7d987d9f23a9969b1f67f46e.zip
CMake-3c47ac5b2571939f7d987d9f23a9969b1f67f46e.tar.gz
CMake-3c47ac5b2571939f7d987d9f23a9969b1f67f46e.tar.bz2
OpenWatcom: Add workaround for lack of error on missing library
The OpenWatcom tools do not fail to link when a library is missing if no symbols were needed from it. This can break `try_compile` checks. Teach `cmGlobalGenerator::Build` to pretend that the build tool returned non-zero if the output contains the corresponding warning.
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r--Source/cmGlobalGenerator.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index f9eb90f..cf277d5 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1893,6 +1893,13 @@ int cmGlobalGenerator::Build(const std::string& /*unused*/,
retVal = 1;
}
+ // The OpenWatcom tools do not return an error code when a link
+ // library is not found!
+ if (this->CMakeInstance->GetState()->UseWatcomWMake() && retVal == 0 &&
+ output.find("W1008: cannot open") != std::string::npos) {
+ retVal = 1;
+ }
+
return retVal;
}