diff options
author | Brad King <brad.king@kitware.com> | 2010-12-14 19:38:18 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2010-12-14 19:38:18 (GMT) |
commit | f1adcefdf419cee3c358c279984bca1dc69cddc6 (patch) | |
tree | 17bde461cf9001fc157a9a392c476adc645c1ea9 /Source/cmTarget.cxx | |
parent | 24b251ac555a7cb1d3fa8fb4cfc8d0bbb38aac3d (diff) | |
parent | 3b7f9014942dc79a24c90904312af768a180ae9d (diff) | |
download | CMake-f1adcefdf419cee3c358c279984bca1dc69cddc6.zip CMake-f1adcefdf419cee3c358c279984bca1dc69cddc6.tar.gz CMake-f1adcefdf419cee3c358c279984bca1dc69cddc6.tar.bz2 |
Merge topic 'cross-compile-apple-host'
3b7f901 Fix soname in cross-compiled targets with Mac host (#11547)
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index dd0e7aa..ef274b4 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -3205,6 +3205,7 @@ void cmTarget::GetLibraryNames(std::string& name, // the library version as the soversion. soversion = version; } + bool isApple = this->Makefile->IsOn("APPLE"); // Get the components of the library name. std::string prefix; @@ -3216,26 +3217,33 @@ void cmTarget::GetLibraryNames(std::string& name, name = prefix+base+suffix; // The library's soname. -#if defined(__APPLE__) - soName = prefix+base; -#else - soName = name; -#endif + if(isApple) + { + soName = prefix+base; + } + else + { + soName = name; + } if(soversion) { soName += "."; soName += soversion; } -#if defined(__APPLE__) - soName += suffix; -#endif + if(isApple) + { + soName += suffix; + } // The library's real name on disk. -#if defined(__APPLE__) - realName = prefix+base; -#else + if(isApple) + { + realName = prefix+base; + } + else + { realName = name; -#endif + } if(version) { realName += "."; @@ -3246,9 +3254,10 @@ void cmTarget::GetLibraryNames(std::string& name, realName += "."; realName += soversion; } -#if defined(__APPLE__) - realName += suffix; -#endif + if(isApple) + { + realName += suffix; + } // The import library name. if(this->GetType() == cmTarget::SHARED_LIBRARY || |