Build: auto detection of libraries built by "make deps" on Linux.
Use the libraries if they exist in ../lib/linux_x86_64 or similar, so that you can run "make deps && make full" to get a full static build. Note that install_deps.sh is still the only officially supported way to build Blender dependencies on Linux, but this may be useful to some. Differential Revision: https://developer.blender.org/D2980
This commit is contained in:
@@ -48,6 +48,11 @@ DEPS_SOURCE_DIR:=$(BLENDER_DIR)/build_files/build_environment
|
|||||||
DEPS_BUILD_DIR:=$(BUILD_DIR)/deps
|
DEPS_BUILD_DIR:=$(BUILD_DIR)/deps
|
||||||
DEPS_INSTALL_DIR:=$(shell dirname "$(BLENDER_DIR)")/lib/$(OS_NCASE)
|
DEPS_INSTALL_DIR:=$(shell dirname "$(BLENDER_DIR)")/lib/$(OS_NCASE)
|
||||||
|
|
||||||
|
ifneq ($(OS_NCASE),darwin)
|
||||||
|
# Add processor type to directory name
|
||||||
|
DEPS_INSTALL_DIR:=$(DEPS_INSTALL_DIR)_$(shell uname -p)
|
||||||
|
endif
|
||||||
|
|
||||||
# Allow to use alternative binary (pypy3, etc)
|
# Allow to use alternative binary (pypy3, etc)
|
||||||
ifndef PYTHON
|
ifndef PYTHON
|
||||||
PYTHON:=python3
|
PYTHON:=python3
|
||||||
|
@@ -23,6 +23,19 @@
|
|||||||
|
|
||||||
# Libraries configuration for any *nix system including Linux and Unix.
|
# Libraries configuration for any *nix system including Linux and Unix.
|
||||||
|
|
||||||
|
# Detect precompiled library directory
|
||||||
|
set(LIBDIR_NAME ${CMAKE_SYSTEM_NAME}_${CMAKE_SYSTEM_PROCESSOR})
|
||||||
|
string(TOLOWER ${LIBDIR_NAME} LIBDIR_NAME)
|
||||||
|
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_NAME})
|
||||||
|
|
||||||
|
if(EXISTS ${LIBDIR})
|
||||||
|
file(GLOB LIB_SUBDIRS ${LIBDIR}/*)
|
||||||
|
set(CMAKE_PREFIX_PATH ${LIB_SUBDIRS})
|
||||||
|
set(WITH_STATIC_LIBS ON)
|
||||||
|
set(WITH_OPENMP_STATIC ON)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Wrapper to prefer static libraries
|
||||||
macro(find_package_wrapper)
|
macro(find_package_wrapper)
|
||||||
if(WITH_STATIC_LIBS)
|
if(WITH_STATIC_LIBS)
|
||||||
find_package_static(${ARGV})
|
find_package_static(${ARGV})
|
||||||
@@ -141,8 +154,15 @@ if(WITH_CODEC_SNDFILE)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WITH_CODEC_FFMPEG)
|
if(WITH_CODEC_FFMPEG)
|
||||||
|
if(EXISTS ${LIBDIR})
|
||||||
|
# For precompiled lib directory, all ffmpeg dependencies are in the same folder
|
||||||
|
file(GLOB ffmpeg_libs ${LIBDIR}/ffmpeg/lib/*.a ${LIBDIR}/sndfile/lib/*.a)
|
||||||
|
set(FFMPEG ${LIBDIR}/ffmpeg CACHE PATH "FFMPEG Directory")
|
||||||
|
set(FFMPEG_LIBRARIES ${ffmpeg_libs} ${ffmpeg_libs} CACHE STRING "FFMPEG Libraries")
|
||||||
|
else()
|
||||||
set(FFMPEG /usr CACHE PATH "FFMPEG Directory")
|
set(FFMPEG /usr CACHE PATH "FFMPEG Directory")
|
||||||
set(FFMPEG_LIBRARIES avformat avcodec avutil avdevice swscale CACHE STRING "FFMPEG Libraries")
|
set(FFMPEG_LIBRARIES avformat avcodec avutil avdevice swscale CACHE STRING "FFMPEG Libraries")
|
||||||
|
endif()
|
||||||
|
|
||||||
mark_as_advanced(FFMPEG)
|
mark_as_advanced(FFMPEG)
|
||||||
|
|
||||||
@@ -329,6 +349,14 @@ if(WITH_OPENCOLORIO)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WITH_LLVM)
|
if(WITH_LLVM)
|
||||||
|
# Symbol conflicts with same UTF library used by OpenCollada
|
||||||
|
if(EXISTS ${LIBDIR})
|
||||||
|
set(LLVM_STATIC ON)
|
||||||
|
if(WITH_OPENCOLLADA)
|
||||||
|
list(REMOVE_ITEM OPENCOLLADA_LIBRARIES ${OPENCOLLADA_UTF_LIBRARY})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
find_package_wrapper(LLVM)
|
find_package_wrapper(LLVM)
|
||||||
|
|
||||||
if(NOT LLVM_FOUND)
|
if(NOT LLVM_FOUND)
|
||||||
|
Reference in New Issue
Block a user