From 462cf254270fbd56bffc73b00dc28882fdb0bdd6 Mon Sep 17 00:00:00 2001 From: Steven Newbury Date: Mon, 27 Feb 2017 21:06:51 +0000 Subject: 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 --- Source/cmMakefile.cxx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'Source/cmMakefile.cxx') 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; -- cgit v1.2.1