diff options
author | Stephen Kelly <steveire@gmail.com> | 2013-04-13 12:46:57 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-11-19 17:39:39 (GMT) |
commit | 7cd65c97fabd9f3249739a81dd1260a1e0b59ee1 (patch) | |
tree | 27ba5ee0d30c9a59ed288806ca1ce40060dd4f0f /Source/cmCoreTryCompile.cxx | |
parent | 5096967ecd443f3d7477d823e7ffdffcc15a8ed1 (diff) | |
download | CMake-7cd65c97fabd9f3249739a81dd1260a1e0b59ee1.zip CMake-7cd65c97fabd9f3249739a81dd1260a1e0b59ee1.tar.gz CMake-7cd65c97fabd9f3249739a81dd1260a1e0b59ee1.tar.bz2 |
Add CMAKE_SYSROOT variable to set --sysroot when cross compiling.
As CMAKE_ROOT_FIND_PATH can be a list, a new CMAKE_SYSROOT is
introduced, which is never a list.
The contents of this variable is passed to supporting compilers
as --sysroot. It is also accounted for when processing implicit
link directories reported by the compiler, and when generating
RPATH information.
Diffstat (limited to 'Source/cmCoreTryCompile.cxx')
-rw-r--r-- | Source/cmCoreTryCompile.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 900f09f..bbfc427 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -433,6 +433,13 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv) flag += tcDef; cmakeFlags.push_back(flag); } + if (const char *rootDef + = this->Makefile->GetDefinition("CMAKE_SYSROOT")) + { + std::string flag="-DCMAKE_SYSROOT="; + flag += rootDef; + cmakeFlags.push_back(flag); + } if(this->Makefile->GetDefinition("CMAKE_POSITION_INDEPENDENT_CODE")!=0) { fprintf(fout, "set(CMAKE_POSITION_INDEPENDENT_CODE \"ON\")\n"); |