diff options
author | Brad King <brad.king@kitware.com> | 2012-06-20 15:04:35 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-06-20 15:26:05 (GMT) |
commit | 56148fd2bc5ddbf32b89bbf94034ea4b14c6716d (patch) | |
tree | 5b6e08f2865bffcafa981fc7e2cc4c8c2bfa0f32 /Source/cmMakefile.cxx | |
parent | 8df7aa54f0f78d48e4ed91001ac9ac9d39dbf535 (diff) | |
download | CMake-56148fd2bc5ddbf32b89bbf94034ea4b14c6716d.zip CMake-56148fd2bc5ddbf32b89bbf94034ea4b14c6716d.tar.gz CMake-56148fd2bc5ddbf32b89bbf94034ea4b14c6716d.tar.bz2 |
Do not crash on SHARED library without language (#13324)
Since commit e1409ac5 (Support building shared libraries or modules
without soname, 2012-04-22) CMake crashes on the code
add_library(foo SHARED foo.nolang)
because the logic to lookup the language's soname flag was moved from
cmTarget::GetLibraryNames to cmMakefile::GetSONameFlag without its check
for a NULL language. Restore the check for NULL.
Add RunCMake.Languages test to cover language error cases like this one.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 0a709ae..1d78b3a 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2197,8 +2197,12 @@ bool cmMakefile::PlatformIs64Bit() const const char* cmMakefile::GetSONameFlag(const char* language) const { - std::string name = "CMAKE_SHARED_LIBRARY_SONAME_"; - name += language; + std::string name = "CMAKE_SHARED_LIBRARY_SONAME"; + if(language) + { + name += "_"; + name += language; + } name += "_FLAG"; return GetDefinition(name.c_str()); } |