diff options
author | Steven Newbury <steve@snewbury.org.uk> | 2017-02-27 21:06:51 +0000 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-03-07 15:22:55 -0500 |
commit | 462cf254270fbd56bffc73b00dc28882fdb0bdd6 (patch) | |
tree | ff0ebb25613ba68d21b9b50f60f1f53f2ea05d79 /Source/cmMakefile.cxx | |
parent | 06ef23c3e0abf79f451cf69fbd3ac646b7e17c27 (diff) | |
download | cmake-462cf254270fbd56bffc73b00dc28882fdb0bdd6.tar.gz |
Add support for x32-abi
Detect x32-abi through CMakeCompilerABI infrastruture and use this
information at runtime to determine the correct library paths with
`FIND_LIBRARY_USE_LIBX32_PATHS`.
Fixes: #15994
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index c75d101ddc..da32dd78f7 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2149,6 +2149,12 @@ bool cmMakefile::IsSet(const std::string& name) const bool cmMakefile::PlatformIs32Bit() const { + if (const char* plat_abi = + this->GetDefinition("CMAKE_INTERNAL_PLATFORM_ABI")) { + if (strcmp(plat_abi, "ELF X32") == 0) { + return false; + } + } if (const char* sizeof_dptr = this->GetDefinition("CMAKE_SIZEOF_VOID_P")) { return atoi(sizeof_dptr) == 4; } @@ -2163,6 +2169,17 @@ bool cmMakefile::PlatformIs64Bit() const return false; } +bool cmMakefile::PlatformIsx32() const +{ + if (const char* plat_abi = + this->GetDefinition("CMAKE_INTERNAL_PLATFORM_ABI")) { + if (strcmp(plat_abi, "ELF X32") == 0) { + return true; + } + } + return false; +} + bool cmMakefile::PlatformIsAppleIos() const { std::string sdkRoot; |