diff options
author | Stephen Kelly <steveire@gmail.com> | 2013-08-08 15:36:36 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-11-19 17:39:34 (GMT) |
commit | 5096967ecd443f3d7477d823e7ffdffcc15a8ed1 (patch) | |
tree | 3698fa4cad976ec180a879172a8df7dd99a6a721 /Source/cmCoreTryCompile.cxx | |
parent | 76552d595db509d47e9bf179aac7a00e2f1fcfae (diff) | |
download | CMake-5096967ecd443f3d7477d823e7ffdffcc15a8ed1.zip CMake-5096967ecd443f3d7477d823e7ffdffcc15a8ed1.tar.gz CMake-5096967ecd443f3d7477d823e7ffdffcc15a8ed1.tar.bz2 |
Allow toolchain files to specify an external toolchain.
Clang can compile code, but uses the gcc tools for other tasks such
as linking. The -gcc-toolchain option can be used for that, but
generalize so that other compilers can be treated the same.
If such a location is specified, use it as a hint for finding
the binutils executables.
Diffstat (limited to 'Source/cmCoreTryCompile.cxx')
-rw-r--r-- | Source/cmCoreTryCompile.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 5bf8ce5..900f09f 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -419,6 +419,20 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv) flag += cDef; cmakeFlags.push_back(flag); } + if (const char *tcxxDef = this->Makefile->GetDefinition( + "CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN")) + { + std::string flag="-DCMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN="; + flag += tcxxDef; + cmakeFlags.push_back(flag); + } + if (const char *tcDef = this->Makefile->GetDefinition( + "CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN")) + { + std::string flag="-DCMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN="; + flag += tcDef; + cmakeFlags.push_back(flag); + } if(this->Makefile->GetDefinition("CMAKE_POSITION_INDEPENDENT_CODE")!=0) { fprintf(fout, "set(CMAKE_POSITION_INDEPENDENT_CODE \"ON\")\n"); |