diff options
author | Matt McCormick <matt.mccormick@kitware.com> | 2015-01-02 03:30:08 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-01-26 15:05:26 (GMT) |
commit | e2b1f0583f7293bce280dfab397e96acf8a5b26e (patch) | |
tree | d3bbabefbf6fb944f4f2ada8fd3a0765a7964879 /Source | |
parent | 07cbe3640e3afc879a07b6510de4c6e437f43f3e (diff) | |
download | CMake-e2b1f0583f7293bce280dfab397e96acf8a5b26e.zip CMake-e2b1f0583f7293bce280dfab397e96acf8a5b26e.tar.gz CMake-e2b1f0583f7293bce280dfab397e96acf8a5b26e.tar.bz2 |
try_run: Add support for LINK_LIBRARIES option.
Most functionality is already implemented in Source/cmCoreTryCompile.{h,cxx}.
Document and improve argument parsing.
This functionality is already being used by a number of modules, like
CheckCSourceCompiles.cmake, but it is not documented.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmCoreTryCompile.cxx | 2 | ||||
-rw-r--r-- | Source/cmTryRunCommand.cxx | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 0030b84..2f58d96 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -109,7 +109,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv) } default: this->Makefile->IssueMessage(cmake::FATAL_ERROR, - "Only libraries may be used as try_compile IMPORTED " + "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()) + "."); return -1; diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx index 8f2deeb..8bd33d0 100644 --- a/Source/cmTryRunCommand.cxx +++ b/Source/cmTryRunCommand.cxx @@ -48,7 +48,8 @@ bool cmTryRunCommand { ++i; while (i < argv.size() && argv[i] != "COMPILE_DEFINITIONS" && - argv[i] != "CMAKE_FLAGS") + argv[i] != "CMAKE_FLAGS" && + argv[i] != "LINK_LIBRARIES") { runArgs += " "; runArgs += argv[i]; |