diff options
author | Nathan Craddock <nzcraddock@gmail.com> | 2020-02-21 08:09:14 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2020-02-26 20:12:18 +0300 |
commit | 30b3bf2b5779b82bac146913b2066001ef9c7089 (patch) | |
tree | bd43318e2ae92c50835cabce8ba4db758627cce1 /build_files/cmake/platform/platform_unix.cmake | |
parent | 9dbfc7ca8bf4453c0ad0f5798405a23fe425d747 (diff) |
Build: ignore system paths when using precompiled libraries on Linux
Based on work by Nathan Craddock, with further changes to apply it to all
precompiled libraries.
Differential Revision: https://developer.blender.org/D6929
Diffstat (limited to 'build_files/cmake/platform/platform_unix.cmake')
-rw-r--r-- | build_files/cmake/platform/platform_unix.cmake | 77 |
1 files changed, 47 insertions, 30 deletions
diff --git a/build_files/cmake/platform/platform_unix.cmake b/build_files/cmake/platform/platform_unix.cmake index ac570f17e47..3b40f7c329b 100644 --- a/build_files/cmake/platform/platform_unix.cmake +++ b/build_files/cmake/platform/platform_unix.cmake @@ -72,26 +72,21 @@ macro(find_package_wrapper) endif() endmacro() +# ---------------------------------------------------------------------------- +# Precompiled Libraries +# +# These are libraries that may be precompiled. For this we disable searching in +# the system directories so that we don't accidentally use them instead. + +if(EXISTS ${LIBDIR}) + without_system_libs_begin() +endif() + find_package_wrapper(JPEG REQUIRED) find_package_wrapper(PNG REQUIRED) find_package_wrapper(ZLIB REQUIRED) find_package_wrapper(Freetype REQUIRED) -if(WITH_LZO AND WITH_SYSTEM_LZO) - find_package_wrapper(LZO) - if(NOT LZO_FOUND) - message(FATAL_ERROR "Failed finding system LZO version!") - endif() -endif() - -if(WITH_SYSTEM_EIGEN3) - find_package_wrapper(Eigen3) - if(NOT EIGEN3_FOUND) - message(FATAL_ERROR "Failed finding system Eigen3 version!") - endif() -endif() -# else values are set below for all platforms - if(WITH_PYTHON) # No way to set py35, remove for now. # find_package(PythonLibs) @@ -126,14 +121,6 @@ if(WITH_IMAGE_TIFF) endif() endif() -# Audio IO -if(WITH_SYSTEM_AUDASPACE) - find_package_wrapper(Audaspace) - if(NOT AUDASPACE_FOUND OR NOT AUDASPACE_C_FOUND) - message(FATAL_ERROR "Audaspace external library not found!") - endif() -endif() - if(WITH_OPENAL) find_package_wrapper(OpenAL) if(NOT OPENAL_FOUND) @@ -166,13 +153,6 @@ if(WITH_SDL) endif() endif() -if(WITH_JACK) - find_package_wrapper(Jack) - if(NOT JACK_FOUND) - set(WITH_JACK OFF) - endif() -endif() - # Codecs if(WITH_CODEC_SNDFILE) find_package_wrapper(SndFile) @@ -448,6 +428,13 @@ if(WITH_TBB) find_package_wrapper(TBB) endif() +if(EXISTS ${LIBDIR}) + without_system_libs_end() +endif() + +# ---------------------------------------------------------------------------- +# Build and Link Flags + # OpenSuse needs lutil, ArchLinux not, for now keep, can avoid by using --as-needed if(HAIKU) list(APPEND PLATFORM_LINKLIBS -lnetwork) @@ -480,6 +467,36 @@ 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(WITH_LZO AND WITH_SYSTEM_LZO) + find_package_wrapper(LZO) + if(NOT LZO_FOUND) + message(FATAL_ERROR "Failed finding system LZO version!") + endif() +endif() + +if(WITH_SYSTEM_EIGEN3) + find_package_wrapper(Eigen3) + if(NOT EIGEN3_FOUND) + message(FATAL_ERROR "Failed finding system Eigen3 version!") + endif() +endif() + +# Jack is intended to use the system library. +if(WITH_JACK) + find_package_wrapper(Jack) + if(NOT JACK_FOUND) + set(WITH_JACK OFF) + endif() +endif() + +# Audio IO +if(WITH_SYSTEM_AUDASPACE) + find_package_wrapper(Audaspace) + if(NOT AUDASPACE_FOUND OR NOT AUDASPACE_C_FOUND) + message(FATAL_ERROR "Audaspace external library not found!") + endif() +endif() + if(WITH_X11) find_package(X11 REQUIRED) |