Merge topic 'master'

d9bdcf34 Tests: Add x32 tests to test suite
5b6d354f Help: Add notes for topic 'x32-abi'
bed9c73d Modules: Add x32-abi support to hard-coded paths
462cf254 Add support for x32-abi

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !532
This commit is contained in:
Brad King 2017-03-09 16:08:06 +00:00 committed by Kitware Robot
commit c4f9d10426
36 changed files with 128 additions and 16 deletions

View File

@ -53,7 +53,8 @@ If the :variable:`CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX` variable is set all
search paths will be tested as normal, with the suffix appended, and with
all matches of ``lib/`` replaced with
``lib${CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX}/``. This variable overrides
the :prop_gbl:`FIND_LIBRARY_USE_LIB32_PATHS`
the :prop_gbl:`FIND_LIBRARY_USE_LIB32_PATHS`,
:prop_gbl:`FIND_LIBRARY_USE_LIBX32_PATHS`,
and :prop_gbl:`FIND_LIBRARY_USE_LIB64_PATHS` global properties.
If the :prop_gbl:`FIND_LIBRARY_USE_LIB32_PATHS` global property is set
@ -63,6 +64,13 @@ automatically set for the platforms that are known to need it if at
least one of the languages supported by the :command:`project` command
is enabled.
If the :prop_gbl:`FIND_LIBRARY_USE_LIBX32_PATHS` global property is set
all search paths will be tested as normal, with ``x32/`` appended, and
with all matches of ``lib/`` replaced with ``libx32/``. This property is
automatically set for the platforms that are known to need it if at
least one of the languages supported by the :command:`project` command
is enabled.
If the :prop_gbl:`FIND_LIBRARY_USE_LIB64_PATHS` global property is set
all search paths will be tested as normal, with ``64/`` appended, and
with all matches of ``lib/`` replaced with ``lib64/``. This property is

View File

@ -26,6 +26,7 @@ Properties of Global Scope
/prop_gbl/ENABLED_LANGUAGES
/prop_gbl/FIND_LIBRARY_USE_LIB32_PATHS
/prop_gbl/FIND_LIBRARY_USE_LIB64_PATHS
/prop_gbl/FIND_LIBRARY_USE_LIBX32_PATHS
/prop_gbl/FIND_LIBRARY_USE_OPENBSD_VERSIONING
/prop_gbl/GLOBAL_DEPENDS_DEBUG_MODE
/prop_gbl/GLOBAL_DEPENDS_NO_CYCLES

View File

@ -0,0 +1,12 @@
FIND_LIBRARY_USE_LIBX32_PATHS
-----------------------------
Whether the :command:`find_library` command should automatically search
``libx32`` directories.
``FIND_LIBRARY_USE_LIBX32_PATHS`` is a boolean specifying whether the
:command:`find_library` command should automatically search the ``libx32``
variant of directories called ``lib`` in the search path when building
x32-abi binaries.
See also the :variable:`CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX` variable.

View File

@ -0,0 +1,6 @@
x32-abi
-------
* The :command:`find_library` command learned to search ``libx32`` paths
when the build targets the ``x32`` ABI. See the
:prop_gbl:`FIND_LIBRARY_USE_LIBX32_PATHS` global property.

View File

@ -9,3 +9,4 @@ This overrides the behavior of related global properties:
* :prop_gbl:`FIND_LIBRARY_USE_LIB32_PATHS`
* :prop_gbl:`FIND_LIBRARY_USE_LIB64_PATHS`
* :prop_gbl:`FIND_LIBRARY_USE_LIBX32_PATHS`

View File

@ -25,6 +25,10 @@ const char info_sizeof_dptr[] = {
#elif defined(__GNU__) && defined(__ELF__) && defined(__ARMEL__)
#define ABI_ID "ELF ARM"
#elif defined(__linux__) && defined(__ELF__) && defined(__amd64__) && \
defined(__ILP32__)
#define ABI_ID "ELF X32"
#elif defined(__ELF__)
#define ABI_ID "ELF"
#endif

View File

@ -1044,7 +1044,7 @@ function(cpack_rpm_prepare_content_list)
endif()
if(NOT DEFINED CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST)
set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST /etc /etc/init.d /usr /usr/share /usr/share/doc /usr/bin /usr/lib /usr/lib64 /usr/include)
set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST /etc /etc/init.d /usr /usr/share /usr/share/doc /usr/bin /usr/lib /usr/lib64 /usr/libx32 /usr/include)
if(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION)
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: Adding ${CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION} to builtin omit list.")

View File

@ -45,7 +45,7 @@ find_path(IL_INCLUDE_DIR il.h
find_library(IL_LIBRARIES
NAMES IL DEVIL
PATH_SUFFIXES lib64 lib lib32
PATH_SUFFIXES libx32 lib64 lib lib32
DOC "The file that corresponds to the base il library."
)
@ -53,7 +53,7 @@ find_library(IL_LIBRARIES
find_library(ILUT_LIBRARIES
NAMES ILUT
PATH_SUFFIXES lib64 lib lib32
PATH_SUFFIXES libx32 lib64 lib lib32
DOC "The file that corresponds to the il (system?) utility library."
)
@ -61,7 +61,7 @@ find_library(ILUT_LIBRARIES
find_library(ILU_LIBRARIES
NAMES ILU
PATH_SUFFIXES lib64 lib lib32
PATH_SUFFIXES libx32 lib64 lib lib32
DOC "The file that corresponds to the il utility library."
)

View File

@ -27,7 +27,7 @@
find_path(GLEW_INCLUDE_DIR GL/glew.h)
if(NOT GLEW_LIBRARY)
find_library(GLEW_LIBRARY_RELEASE NAMES GLEW glew32 glew glew32s PATH_SUFFIXES lib64)
find_library(GLEW_LIBRARY_RELEASE NAMES GLEW glew32 glew glew32s PATH_SUFFIXES lib64 libx32)
find_library(GLEW_LIBRARY_DEBUG NAMES GLEWd glew32d glewd PATH_SUFFIXES lib64)
include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)

View File

@ -292,8 +292,10 @@ function(_GTK2_FIND_INCLUDE_DIR _var _hdr)
find_path(GTK2_${_var}_INCLUDE_DIR ${_hdr}
PATHS
${_gtk2_arch_dir}
/usr/local/libx32
/usr/local/lib64
/usr/local/lib
/usr/libx32
/usr/lib64
/usr/lib
/usr/X11R6/include

View File

@ -198,7 +198,7 @@ function(_Ice_FIND)
endif()
# Generic 64-bit and 32-bit directories
list(APPEND ice_binary_suffixes "bin${_x64}" "bin")
list(APPEND ice_library_suffixes "${_lib64}" "lib${_x64}" "lib")
list(APPEND ice_library_suffixes "libx32" "${_lib64}" "lib${_x64}" "lib")
list(APPEND ice_include_suffixes "include")
list(APPEND ice_slice_suffixes "slice")

View File

@ -221,6 +221,8 @@ get_filename_component(KDE3_LIB_DIR ${KDE3_KDECORE_LIBRARY} PATH )
if(NOT KDE3_LIBTOOL_DIR)
if(KDE3_KDECORE_LIBRARY MATCHES lib64)
set(KDE3_LIBTOOL_DIR /lib64/kde3)
elseif(KDE3_KDECORE_LIBRARY MATCHES libx32)
set(KDE3_LIBTOOL_DIR /libx32/kde3)
else()
set(KDE3_LIBTOOL_DIR /lib/kde3)
endif()

View File

@ -79,7 +79,7 @@ find_library(OPENAL_LIBRARY
NAMES OpenAL al openal OpenAL32
HINTS
ENV OPENALDIR
PATH_SUFFIXES lib64 lib libs64 libs ${_OpenAL_ARCH_DIR}
PATH_SUFFIXES libx32 lib64 lib libs64 libs ${_OpenAL_ARCH_DIR}
PATHS
~/Library/Frameworks
/Library/Frameworks

View File

@ -312,6 +312,10 @@ macro(_pkg_check_modules_internal _is_required _is_silent _no_cmake_path _no_cma
if(uselib64 AND CMAKE_SIZEOF_VOID_P EQUAL 8)
list(APPEND _lib_dirs "lib64/pkgconfig")
endif()
get_property(uselibx32 GLOBAL PROPERTY FIND_LIBRARY_USE_LIBX32_PATHS)
if(uselibx32 AND CMAKE_INTERNAL_PLATFORM_ABI STREQUAL "ELF X32")
list(APPEND _lib_dirs "libx32/pkgconfig")
endif()
endif()
endif()
list(APPEND _lib_dirs "lib/pkgconfig")

View File

@ -521,7 +521,7 @@ function(gp_resolved_file_type original_file file exepath dirs type_var)
string(TOLOWER "${resolved_file}" lower)
if(UNIX)
if(resolved_file MATCHES "^(/lib/|/lib32/|/lib64/|/usr/lib/|/usr/lib32/|/usr/lib64/|/usr/X11R6/|/usr/bin/)")
if(resolved_file MATCHES "^(/lib/|/lib32/|/libx32/|/lib64/|/usr/lib/|/usr/lib32/|/usr/libx32/|/usr/lib64/|/usr/X11R6/|/usr/bin/)")
set(is_system 1)
endif()
endif()

View File

@ -86,3 +86,4 @@ list(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES
# Enable use of lib32 and lib64 search path variants by default.
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS TRUE)
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE)
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIBX32_PATHS TRUE)

View File

@ -195,8 +195,10 @@ void cmExportInstallFileGenerator::GenerateImportPrefix(std::ostream& os)
<< " \"${CMAKE_CURRENT_LIST_FILE}\" PATH)\n";
if (cmHasLiteralPrefix(absDestS.c_str(), "/lib/") ||
cmHasLiteralPrefix(absDestS.c_str(), "/lib64/") ||
cmHasLiteralPrefix(absDestS.c_str(), "/libx32/") ||
cmHasLiteralPrefix(absDestS.c_str(), "/usr/lib/") ||
cmHasLiteralPrefix(absDestS.c_str(), "/usr/lib64/")) {
cmHasLiteralPrefix(absDestS.c_str(), "/usr/lib64/") ||
cmHasLiteralPrefix(absDestS.c_str(), "/usr/libx32/")) {
// Handle "/usr move" symlinks created by some Linux distros.
/* clang-format off */
os <<

View File

@ -43,7 +43,8 @@ bool cmFindLibraryCommand::InitialPass(std::vector<std::string> const& argsIn,
return true;
}
// add custom lib<qual> paths instead of using fixed lib32 or lib64
// add custom lib<qual> paths instead of using fixed lib32, lib64 or
// libx32
if (const char* customLib = this->Makefile->GetDefinition(
"CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX")) {
this->AddArchitecturePaths(customLib);
@ -60,6 +61,12 @@ bool cmFindLibraryCommand::InitialPass(std::vector<std::string> const& argsIn,
"FIND_LIBRARY_USE_LIB64_PATHS")) {
this->AddArchitecturePaths("64");
}
// add special 32 bit paths if this is an x32 compile.
else if (this->Makefile->PlatformIsx32() &&
this->Makefile->GetState()->GetGlobalPropertyAsBool(
"FIND_LIBRARY_USE_LIBX32_PATHS")) {
this->AddArchitecturePaths("x32");
}
std::string library = this->FindLibrary();
if (library != "") {

View File

@ -92,6 +92,7 @@ cmFindPackageCommand::cmFindPackageCommand()
this->DebugMode = false;
this->UseLib32Paths = false;
this->UseLib64Paths = false;
this->UseLibx32Paths = false;
this->PolicyScope = true;
this->VersionMajor = 0;
this->VersionMinor = 0;
@ -173,6 +174,13 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args,
this->UseLib64Paths = true;
}
// Lookup whether libx32 paths should be used.
if (this->Makefile->PlatformIsx32() &&
this->Makefile->GetState()->GetGlobalPropertyAsBool(
"FIND_LIBRARY_USE_LIBX32_PATHS")) {
this->UseLibx32Paths = true;
}
// Check if User Package Registry should be disabled
if (this->Makefile->IsOn("CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY")) {
this->NoUserRegistry = true;
@ -2002,6 +2010,9 @@ bool cmFindPackageCommand::SearchPrefix(std::string const& prefix_in)
if (this->UseLib64Paths) {
common.push_back("lib64");
}
if (this->UseLibx32Paths) {
common.push_back("libx32");
}
common.push_back("lib");
common.push_back("share");

View File

@ -169,6 +169,7 @@ private:
bool DebugMode;
bool UseLib32Paths;
bool UseLib64Paths;
bool UseLibx32Paths;
bool PolicyScope;
std::string LibraryArchitecture;
std::vector<std::string> Names;

View File

@ -2150,6 +2150,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;
}
@ -2164,6 +2170,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;

View File

@ -436,6 +436,8 @@ public:
/** Return whether the target platform is 64-bit. */
bool PlatformIs64Bit() const;
/** Return whether the target platform is x32. */
bool PlatformIsx32() const;
/** Return whether the target platform is Apple iOS. */
bool PlatformIsAppleIos() const;

View File

@ -33,9 +33,11 @@ endmacro()
set(CMAKE_FIND_LIBRARY_PREFIXES "lib")
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIBX32_PATHS TRUE)
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS TRUE)
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE)
set(CMAKE_INTERNAL_PLATFORM_ABI "ELF")
set(CMAKE_SIZEOF_VOID_P 4)
foreach(lib
lib/32/libtest5.a
@ -67,6 +69,20 @@ foreach(lib64
test_find_library_subst(${lib64})
endforeach()
set(CMAKE_INTERNAL_PLATFORM_ABI "ELF X32")
set(CMAKE_SIZEOF_VOID_P 4)
foreach(libx32
lib/x32/libtest2.a
lib/A/libx32/libtest3.a
lib/libtest3.a
libx32/A/lib/libtest2.a
libx32/A/libx32/libtest1.a
libx32/A/libtest1.a
libx32/libtest1.a
)
test_find_library_subst(${libx32})
endforeach()
test_find_library("" A/libtestA.a
NAMES testA testB
PATHS ${CMAKE_CURRENT_SOURCE_DIR}/A ${CMAKE_CURRENT_SOURCE_DIR}/B

View File

@ -30,9 +30,12 @@ if(NOT DEFINED CMAKE_SYSTEM_NAME
endif()
else()
# not debian, check the FIND_LIBRARY_USE_LIB32_PATHS and FIND_LIBRARY_USE_LIB64_PATHS properties
get_property(uselibx32 GLOBAL PROPERTY FIND_LIBRARY_USE_LIBX32_PATHS)
get_property(uselib32 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS)
get_property(uselib64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)
if(uselib32 AND CMAKE_SIZEOF_VOID_P EQUAL 4)
if(uselibx32 AND CMAKE_INTERNAL_PLATFORM_ABI STREQUAL "ELF X32")
set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/libx32/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/libx32/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig")
elseif(uselib32 AND CMAKE_SIZEOF_VOID_P EQUAL 4)
set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib32/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib32/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig")
elseif(uselib64 AND CMAKE_SIZEOF_VOID_P EQUAL 8)
set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib64/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib64/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig")

View File

@ -30,9 +30,12 @@ if(NOT DEFINED CMAKE_SYSTEM_NAME
endif()
else()
# not debian, check the FIND_LIBRARY_USE_LIB64_PATHS and FIND_LIBRARY_USE_LIB64_PATHS properties
get_property(uselibx32 GLOBAL PROPERTY FIND_LIBRARY_USE_LIBX32_PATHS)
get_property(uselib32 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS)
get_property(uselib64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)
if(uselib32 AND CMAKE_SIZEOF_VOID_P EQUAL 4)
if(uselibx32 AND CMAKE_INTERNAL_PLATFORM_ABI STREQUAL "ELF X32")
set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/libx32/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/libx32/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig")
elseif(uselib32 AND CMAKE_SIZEOF_VOID_P EQUAL 4)
set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib32/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib32/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig")
elseif(uselib64 AND CMAKE_SIZEOF_VOID_P EQUAL 8)
set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib64/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib64/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig")

View File

@ -30,9 +30,12 @@ if(NOT DEFINED CMAKE_SYSTEM_NAME
endif()
else()
# not debian, check the FIND_LIBRARY_USE_LIB32_PATHS and FIND_LIBRARY_USE_LIB64_PATHS propertie
get_property(uselibx32 GLOBAL PROPERTY FIND_LIBRARY_USE_LIBX32_PATHS)
get_property(uselib32 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS)
get_property(uselib64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)
if(uselib32 AND CMAKE_SIZEOF_VOID_P EQUAL 4)
if(uselibx32 AND CMAKE_INTERNAL_PLATFORM_ABI STREQUAL "ELF X32")
set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/libx32/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/libx32/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig")
elseif(uselib32 AND CMAKE_SIZEOF_VOID_P EQUAL 4)
set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib32/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib32/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig")
elseif(uselib64 AND CMAKE_SIZEOF_VOID_P EQUAL 8)
set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib64/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib64/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig")

View File

@ -30,9 +30,12 @@ if(NOT DEFINED CMAKE_SYSTEM_NAME
endif()
else()
# not debian, check the FIND_LIBRARY_USE_LIB32_PATHS and FIND_LIBRARY_USE_LIB64_PATHS properties
get_property(uselibx32 GLOBAL PROPERTY FIND_LIBRARY_USE_LIBX32_PATHS)
get_property(uselib32 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS)
get_property(uselib64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)
if(uselib32 AND CMAKE_SIZEOF_VOID_P EQUAL 4)
if(uselibx32 AND CMAKE_INTERNAL_PLATFORM_ABI STREQUAL "ELF X32")
set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/libx32/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig")
elseif(uselib32 AND CMAKE_SIZEOF_VOID_P EQUAL 4)
set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib32/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig")
elseif(uselib64 AND CMAKE_SIZEOF_VOID_P EQUAL 8)
set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib64/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig")

View File

@ -30,9 +30,12 @@ if(NOT DEFINED CMAKE_SYSTEM_NAME
endif()
else()
# not debian, check the FIND_LIBRARY_USE_LIB64_PATHS and FIND_LIBRARY_USE_LIB32_PATHS properties
get_property(uselibx32 GLOBAL PROPERTY FIND_LIBRARY_USE_LIBX32_PATHS)
get_property(uselib32 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS)
get_property(uselib64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)
if(uselib32 AND CMAKE_SIZEOF_VOID_P EQUAL 4)
if(uselibx32 AND CMAKE_INTERNAL_PLATFORM_ABI STREQUAL "ELF X32")
set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/libx32/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig")
elseif(uselib32 AND CMAKE_SIZEOF_VOID_P EQUAL 4)
set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib32/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig")
elseif(uselib64 AND CMAKE_SIZEOF_VOID_P EQUAL 8)
set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib64/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig")