From 1ac042aa67c0e0ab531cd38977cb2f65fd96ed4b Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 28 Feb 2018 08:43:28 -0500 Subject: 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 --- Source/cmGeneratorTarget.cxx | 5 +++++ 1 file changed, 5 insertions(+) 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()) { -- cgit v0.12