https://github.com/Kitware/CMake
Revision 0c7433e874d5f28b15009dbfb1f19ecb34cd71ee authored by Roland Schulz on 13 April 2018, 00:49:05 UTC, committed by Brad King on 16 April 2018, 18:11:12 UTC
The change in commit v3.11.0-rc1~334^2 (FindOpenMP: Use NO_DEFAULT_PATH where appropriate, 2017-11-15) broke partial support for Intel on Windows. Since `OpenMP_${LANG}_IMPLICIT_LINK_DIRS` is empty for this compiler the `find_library` call without `NO_DEFAULT_PATH` worked accidentally in environments with the needed libraries in the search path already. Fix support for Intel on Windows by simply removing our explicit search for the `libiomp5md` library. In cases that it is needed, the compiler already inserts metadata in `.obj` files to tell the MSVC linker to use the library. Suggested-by: Christian Pfeiffer <cpfeiffer@live.de> Fixes: #17910
1 parent 61fd4c7
Tip revision: 0c7433e874d5f28b15009dbfb1f19ecb34cd71ee authored by Roland Schulz on 13 April 2018, 00:49:05 UTC
FindOpenMP: Fix support for Intel on Windows
FindOpenMP: Fix support for Intel on Windows
Tip revision: 0c7433e
cmLocalCommonGenerator.cxx
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmLocalCommonGenerator.h"
#include <utility>
#include <vector>
#include "cmGeneratorTarget.h"
#include "cmMakefile.h"
#include "cmOutputConverter.h"
class cmGlobalGenerator;
cmLocalCommonGenerator::cmLocalCommonGenerator(cmGlobalGenerator* gg,
cmMakefile* mf,
std::string const& wd)
: cmLocalGenerator(gg, mf)
, WorkingDirectory(wd)
{
// Store the configuration name that will be generated.
if (const char* config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE")) {
// Use the build type given by the user.
this->ConfigName = config;
} else {
// No configuration type given.
this->ConfigName.clear();
}
}
cmLocalCommonGenerator::~cmLocalCommonGenerator()
{
}
std::string cmLocalCommonGenerator::GetTargetFortranFlags(
cmGeneratorTarget const* target, std::string const& config)
{
std::string flags;
// Enable module output if necessary.
if (const char* modout_flag =
this->Makefile->GetDefinition("CMAKE_Fortran_MODOUT_FLAG")) {
this->AppendFlags(flags, modout_flag);
}
// Add a module output directory flag if necessary.
std::string mod_dir =
target->GetFortranModuleDirectory(this->WorkingDirectory);
if (!mod_dir.empty()) {
mod_dir = this->ConvertToOutputFormat(
this->ConvertToRelativePath(this->WorkingDirectory, mod_dir),
cmOutputConverter::SHELL);
} else {
mod_dir =
this->Makefile->GetSafeDefinition("CMAKE_Fortran_MODDIR_DEFAULT");
}
if (!mod_dir.empty()) {
const char* moddir_flag =
this->Makefile->GetRequiredDefinition("CMAKE_Fortran_MODDIR_FLAG");
std::string modflag = moddir_flag;
modflag += mod_dir;
this->AppendFlags(flags, modflag);
}
// If there is a separate module path flag then duplicate the
// include path with it. This compiler does not search the include
// path for modules.
if (const char* modpath_flag =
this->Makefile->GetDefinition("CMAKE_Fortran_MODPATH_FLAG")) {
std::vector<std::string> includes;
this->GetIncludeDirectories(includes, target, "C", config);
for (std::string const& id : includes) {
std::string flg = modpath_flag;
flg += this->ConvertToOutputFormat(id, cmOutputConverter::SHELL);
this->AppendFlags(flags, flg);
}
}
return flags;
}
void cmLocalCommonGenerator::ComputeObjectFilenames(
std::map<cmSourceFile const*, std::string>& mapping,
cmGeneratorTarget const* gt)
{
// Determine if these object files should use a custom extension
char const* custom_ext = gt->GetCustomObjectExtension();
for (auto& si : mapping) {
cmSourceFile const* sf = si.first;
bool keptSourceExtension;
si.second = this->GetObjectFileNameWithoutTarget(
*sf, gt->ObjectDirectory, &keptSourceExtension, custom_ext);
}
}
Computing file changes ...