summaryrefslogtreecommitdiffstats
path: root/Source/cmCoreTryCompile.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2009-05-19 15:25:28 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2009-05-19 15:25:28 (GMT)
commit9c2dcf48362a82819bb1ca2ae6b139c938103d5b (patch)
tree91e9e03fd63f609bfedd5e40e6061b861903b82d /Source/cmCoreTryCompile.cxx
parent831ca4f57ce44b0735151644490bfda8067c13c0 (diff)
downloadCMake-9c2dcf48362a82819bb1ca2ae6b139c938103d5b.zip
CMake-9c2dcf48362a82819bb1ca2ae6b139c938103d5b.tar.gz
CMake-9c2dcf48362a82819bb1ca2ae6b139c938103d5b.tar.bz2
BUG: fix for #0009051 CMake does not pass CMAKE_OSX_SYSROOT and CMAKE_OSX_DEPLOYMENT_TARGET when running TRY_COMPILE
Diffstat (limited to 'Source/cmCoreTryCompile.cxx')
-rw-r--r--Source/cmCoreTryCompile.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index 0ebe2cd..c45a806 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -250,6 +250,20 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
flag += this->Makefile->GetSafeDefinition("CMAKE_OSX_ARCHITECTURES");
cmakeFlags.push_back(flag);
}
+ /* on APPLE also pass CMAKE_OSX_SYSROOT to the try_compile */
+ if(this->Makefile->GetDefinition("CMAKE_OSX_SYSROOT")!=0)
+ {
+ std::string flag="-DCMAKE_OSX_SYSROOT=";
+ flag += this->Makefile->GetSafeDefinition("CMAKE_OSX_SYSROOT");
+ cmakeFlags.push_back(flag);
+ }
+ /* on APPLE also pass CMAKE_OSX_DEPLOYMENT_TARGET to the try_compile */
+ if(this->Makefile->GetDefinition("CMAKE_OSX_DEPLOYMENT_TARGET")!=0)
+ {
+ std::string flag="-DCMAKE_OSX_DEPLOYMENT_TARGET=";
+ flag += this->Makefile->GetSafeDefinition("CMAKE_OSX_DEPLOYMENT_TARGET");
+ cmakeFlags.push_back(flag);
+ }
fprintf(fout, "ADD_EXECUTABLE(cmTryCompileExec \"%s\")\n",source.c_str());
fprintf(fout,