diff --git a/Modules/Platform/Android.cmake b/Modules/Platform/Android.cmake new file mode 100644 index 0000000000..e6d4fcfe94 --- /dev/null +++ b/Modules/Platform/Android.cmake @@ -0,0 +1,9 @@ +include(Platform/Linux) + +# Android has soname, but binary names must end in ".so" so we cannot append +# a version number. Also we cannot portably represent symlinks on the host. +set(CMAKE_PLATFORM_NO_VERSIONED_SONAME 1) + +# Android reportedly ignores RPATH, and we cannot predict the install +# location anyway. +set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "") diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 15acfdd5c9..8143556560 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -4348,6 +4348,7 @@ void cmTarget::GetLibraryNames(std::string& name, const char* version = this->GetProperty("VERSION"); const char* soversion = this->GetProperty("SOVERSION"); if(!this->HasSOName(config) || + this->Makefile->IsOn("CMAKE_PLATFORM_NO_VERSIONED_SONAME") || this->IsFrameworkOnApple()) { // Versioning is supported only for shared libraries and modules,