diff options
Diffstat (limited to 'Source/cmCoreTryCompile.cxx')
-rw-r--r-- | Source/cmCoreTryCompile.cxx | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 3d9c4bf..4a1f770 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -34,7 +34,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv) std::string outputVariable; std::string copyFile; std::string copyFileError; - std::vector<cmTarget const*> targets; + std::vector<std::string> targets; std::string libsToLink = " "; bool useOldLinkLibs = true; char targetNameBuf[64]; @@ -93,12 +93,12 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv) { switch(tgt->GetType()) { - case cmTarget::SHARED_LIBRARY: - case cmTarget::STATIC_LIBRARY: - case cmTarget::INTERFACE_LIBRARY: - case cmTarget::UNKNOWN_LIBRARY: + case cmState::SHARED_LIBRARY: + case cmState::STATIC_LIBRARY: + case cmState::INTERFACE_LIBRARY: + case cmState::UNKNOWN_LIBRARY: break; - case cmTarget::EXECUTABLE: + case cmState::EXECUTABLE: if (tgt->IsExecutableWithExports()) { break; @@ -107,12 +107,12 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv) this->Makefile->IssueMessage(cmake::FATAL_ERROR, "Only libraries may be used as try_compile or try_run IMPORTED " "LINK_LIBRARIES. Got " + std::string(tgt->GetName()) + " of " - "type " + tgt->GetTargetTypeName(tgt->GetType()) + "."); + "type " + cmState::GetTargetTypeName(tgt->GetType()) + "."); return -1; } if (tgt->IsImported()) { - targets.push_back(tgt); + targets.push_back(argv[i]); } } } @@ -375,9 +375,8 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv) if (!targets.empty()) { std::string fname = "/" + std::string(targetName) + "Targets.cmake"; - cmExportTryCompileFileGenerator tcfg(gg); + cmExportTryCompileFileGenerator tcfg(gg, targets, this->Makefile); tcfg.SetExportFile((this->BinaryDirectory + fname).c_str()); - tcfg.SetExports(targets); tcfg.SetConfig(this->Makefile->GetSafeDefinition( "CMAKE_TRY_COMPILE_CONFIGURATION")); |