diff options
Diffstat (limited to 'build_files/cmake')
-rw-r--r-- | build_files/cmake/platform/platform_unix.cmake | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/build_files/cmake/platform/platform_unix.cmake b/build_files/cmake/platform/platform_unix.cmake index 5778699ee49..a3b8b17ec19 100644 --- a/build_files/cmake/platform/platform_unix.cmake +++ b/build_files/cmake/platform/platform_unix.cmake @@ -48,6 +48,9 @@ if(NOT DEFINED LIBDIR) unset(LIBDIR_CENTOS7_ABI) endif() +# Support restoring this value once pre-compiled libraries have been handled. +set(WITH_STATIC_LIBS_INIT ${WITH_STATIC_LIBS}) + if(EXISTS ${LIBDIR}) message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}") @@ -541,6 +544,15 @@ add_definitions(-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE # # Keep last, so indirectly linked libraries don't override our own pre-compiled libs. +if(EXISTS ${LIBDIR}) + # Clear the prefix path as it causes the `LIBDIR` to override system locations. + unset(CMAKE_PREFIX_PATH) + + # Since the pre-compiled `LIBDIR` directories have been handled, don't prefer static libraries. + set(WITH_STATIC_LIBS ${WITH_STATIC_LIBS_INIT}) +endif() + + if(WITH_LZO AND WITH_SYSTEM_LZO) find_package_wrapper(LZO) if(NOT LZO_FOUND) |