diff options
author | Brad King <brad.king@kitware.com> | 2018-02-28 13:43:28 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-02-28 13:52:19 (GMT) |
commit | 1ac042aa67c0e0ab531cd38977cb2f65fd96ed4b (patch) | |
tree | d62b4e882a612f3369efb3ca7476fa930b80f1c8 /Source/cmGeneratorTarget.cxx | |
parent | 82de05088f762371c6cd753ae19533dc9f5cd6b2 (diff) | |
download | CMake-1ac042aa67c0e0ab531cd38977cb2f65fd96ed4b.zip CMake-1ac042aa67c0e0ab531cd38977cb2f65fd96ed4b.tar.gz CMake-1ac042aa67c0e0ab531cd38977cb2f65fd96ed4b.tar.bz2 |
Do not generate rules for .def generation where not supported
Our `cmake -E __create_def` helper used for `WINDOWS_EXPORT_ALL_SYMBOLS`
and merging of multiple `.def` files is available only with CMake hosted
on Windows. However, we may generate use of it on other platforms since
commit v3.9.0-rc1~405^2 (Support WINDOWS_EXPORT_ALL_SYMBOLS with `.def`
files, 2017-03-13) when multiple `.def` files are listed. This results
in a build error because the tool doesn't exist.
Fix our logic to avoid using the tool on non-Windows platforms. Instead
silently ignore all but the first `.def` source as we did before.
Issue: #17773
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index e9b6daf..abbc3d0 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -1999,8 +1999,13 @@ void cmGeneratorTarget::ComputeModuleDefinitionInfo( info.WindowsExportAllSymbols = this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS") && this->GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS"); +#if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE) info.DefFileGenerated = info.WindowsExportAllSymbols || info.Sources.size() > 1; +#else + // Our __create_def helper is only available on Windows. + info.DefFileGenerated = false; +#endif if (info.DefFileGenerated) { info.DefFile = this->ObjectDirectory /* has slash */ + "exports.def"; } else if (!info.Sources.empty()) { |