Build: remove usage of link_directories
We are now always using absolute paths for libraries, as recommended by the CMake docs. Followup to D9177.
This commit is contained in:
parent
75a1a578bd
commit
29450a2af3
|
@ -488,7 +488,6 @@ function(blender_add_test_executable
|
|||
|
||||
include_directories(${includes})
|
||||
include_directories(${includes_sys})
|
||||
setup_libdirs()
|
||||
|
||||
BLENDER_SRC_GTEST_EX(
|
||||
NAME ${name}
|
||||
|
@ -525,83 +524,6 @@ function(setup_heavy_lib_pool)
|
|||
endif()
|
||||
endfunction()
|
||||
|
||||
function(SETUP_LIBDIRS)
|
||||
|
||||
# NOTE: For all new libraries, use absolute library paths.
|
||||
# This should eventually be phased out.
|
||||
# APPLE platform uses full paths for linking libraries, and avoids link_directories.
|
||||
if(NOT MSVC AND NOT APPLE)
|
||||
link_directories(${JPEG_LIBPATH} ${PNG_LIBPATH} ${ZLIB_LIBPATH} ${FREETYPE_LIBPATH})
|
||||
|
||||
if(WITH_PYTHON) # AND NOT WITH_PYTHON_MODULE # WIN32 needs
|
||||
link_directories(${PYTHON_LIBPATH})
|
||||
endif()
|
||||
if(WITH_SDL AND NOT WITH_SDL_DYNLOAD)
|
||||
link_directories(${SDL_LIBPATH})
|
||||
endif()
|
||||
if(WITH_CODEC_FFMPEG)
|
||||
link_directories(${FFMPEG_LIBPATH})
|
||||
endif()
|
||||
if(WITH_IMAGE_OPENEXR)
|
||||
link_directories(${OPENEXR_LIBPATH})
|
||||
endif()
|
||||
if(WITH_IMAGE_TIFF)
|
||||
link_directories(${TIFF_LIBPATH})
|
||||
endif()
|
||||
if(WITH_BOOST)
|
||||
link_directories(${BOOST_LIBPATH})
|
||||
endif()
|
||||
if(WITH_OPENIMAGEIO)
|
||||
link_directories(${OPENIMAGEIO_LIBPATH})
|
||||
endif()
|
||||
if(WITH_OPENIMAGEDENOISE)
|
||||
link_directories(${OPENIMAGEDENOISE_LIBPATH})
|
||||
endif()
|
||||
if(WITH_OPENCOLORIO)
|
||||
link_directories(${OPENCOLORIO_LIBPATH})
|
||||
endif()
|
||||
if(WITH_OPENVDB)
|
||||
link_directories(${OPENVDB_LIBPATH})
|
||||
endif()
|
||||
if(WITH_OPENAL)
|
||||
link_directories(${OPENAL_LIBPATH})
|
||||
endif()
|
||||
if(WITH_JACK AND NOT WITH_JACK_DYNLOAD)
|
||||
link_directories(${JACK_LIBPATH})
|
||||
endif()
|
||||
if(WITH_PULSEAUDIO AND NOT WITH_PULSEAUDIO_DYNLOAD)
|
||||
link_directories(${LIBPULSE_LIBPATH})
|
||||
endif()
|
||||
if(WITH_CODEC_SNDFILE)
|
||||
link_directories(${LIBSNDFILE_LIBPATH})
|
||||
endif()
|
||||
if(WITH_FFTW3)
|
||||
link_directories(${FFTW3_LIBPATH})
|
||||
endif()
|
||||
if(WITH_OPENCOLLADA)
|
||||
link_directories(${OPENCOLLADA_LIBPATH})
|
||||
# # Never set
|
||||
# link_directories(${PCRE_LIBPATH})
|
||||
# link_directories(${EXPAT_LIBPATH})
|
||||
endif()
|
||||
if(WITH_LLVM)
|
||||
link_directories(${LLVM_LIBPATH})
|
||||
endif()
|
||||
|
||||
if(WITH_ALEMBIC)
|
||||
link_directories(${ALEMBIC_LIBPATH})
|
||||
endif()
|
||||
|
||||
if(WITH_GMP)
|
||||
link_directories(${GMP_LIBPATH})
|
||||
endif()
|
||||
|
||||
if(WIN32 AND NOT UNIX)
|
||||
link_directories(${PTHREADS_LIBPATH})
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Platform specific linker flags for targets.
|
||||
function(setup_platform_linker_flags
|
||||
target)
|
||||
|
|
|
@ -51,8 +51,6 @@ list(APPEND LIBRARIES ${CYCLES_GL_LIBRARIES})
|
|||
|
||||
# Common configuration.
|
||||
|
||||
cycles_link_directories()
|
||||
|
||||
add_definitions(${GL_DEFINITIONS})
|
||||
|
||||
include_directories(${INC})
|
||||
|
|
|
@ -84,39 +84,6 @@ macro(cycles_add_library target library_deps)
|
|||
cycles_set_solution_folder(${target})
|
||||
endmacro()
|
||||
|
||||
# Cycles library dependencies common to all executables
|
||||
|
||||
function(cycles_link_directories)
|
||||
if(APPLE)
|
||||
# APPLE platform uses full paths for linking libraries, and avoids link_directories.
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(WITH_OPENCOLORIO)
|
||||
link_directories(${OPENCOLORIO_LIBPATH})
|
||||
endif()
|
||||
if(WITH_OPENVDB)
|
||||
link_directories(${OPENVDB_LIBPATH} ${BLOSC_LIBPATH})
|
||||
endif()
|
||||
if(WITH_OPENSUBDIV)
|
||||
link_directories(${OPENSUBDIV_LIBPATH})
|
||||
endif()
|
||||
if(WITH_OPENIMAGEDENOISE)
|
||||
link_directories(${OPENIMAGEDENOISE_LIBPATH})
|
||||
endif()
|
||||
|
||||
link_directories(
|
||||
${OPENIMAGEIO_LIBPATH}
|
||||
${BOOST_LIBPATH}
|
||||
${PNG_LIBPATH}
|
||||
${JPEG_LIBPATH}
|
||||
${ZLIB_LIBPATH}
|
||||
${TIFF_LIBPATH}
|
||||
${OPENEXR_LIBPATH}
|
||||
${OPENJPEG_LIBPATH}
|
||||
)
|
||||
endfunction()
|
||||
|
||||
macro(cycles_target_link_libraries target)
|
||||
if(WITH_CYCLES_LOGGING)
|
||||
target_link_libraries(${target} ${GLOG_LIBRARIES} ${GFLAGS_LIBRARIES})
|
||||
|
|
|
@ -38,8 +38,6 @@ set(ALL_CYCLES_LIBRARIES
|
|||
)
|
||||
include_directories(${INC})
|
||||
|
||||
cycles_link_directories()
|
||||
|
||||
set(SRC
|
||||
integrator_adaptive_sampling_test.cpp
|
||||
integrator_render_scheduler_test.cpp
|
||||
|
|
|
@ -38,8 +38,6 @@ set(LIB
|
|||
)
|
||||
|
||||
if(WITH_LIBMV)
|
||||
setup_libdirs()
|
||||
|
||||
if(WIN32)
|
||||
add_definitions(-D_USE_MATH_DEFINES)
|
||||
endif()
|
||||
|
|
|
@ -118,8 +118,6 @@ set(LIB
|
|||
)
|
||||
|
||||
if(WITH_LIBMV)
|
||||
setup_libdirs()
|
||||
|
||||
if(WIN32)
|
||||
add_definitions(-D_USE_MATH_DEFINES)
|
||||
endif()
|
||||
|
|
|
@ -23,7 +23,6 @@ set(INC
|
|||
..
|
||||
)
|
||||
|
||||
setup_libdirs()
|
||||
include_directories(${INC})
|
||||
|
||||
BLENDER_TEST_PERFORMANCE(BLI_ghash_performance "bf_blenlib")
|
||||
|
|
|
@ -30,7 +30,6 @@ set(SRC
|
|||
msgfmt.c
|
||||
)
|
||||
|
||||
setup_libdirs()
|
||||
add_cc_flags_custom_test(msgfmt)
|
||||
|
||||
if(WIN32)
|
||||
|
|
|
@ -52,10 +52,6 @@ if(NOT WITH_HEADLESS)
|
|||
endif()
|
||||
|
||||
include_directories(${PNG_INCLUDE_DIRS})
|
||||
if(NOT APPLE)
|
||||
# APPLE platform uses full paths for linking libraries.
|
||||
link_directories(${PNG_LIBPATH} ${ZLIB_LIBPATH})
|
||||
endif()
|
||||
|
||||
add_executable(datatoc_icon ${SRC})
|
||||
setup_platform_linker_flags(datatoc_icon)
|
||||
|
|
|
@ -18,8 +18,6 @@
|
|||
# All rights reserved.
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
setup_libdirs()
|
||||
|
||||
blender_include_dirs(
|
||||
../../intern/clog
|
||||
../../intern/glew-mx
|
||||
|
@ -73,10 +71,6 @@ endif()
|
|||
|
||||
if(WITH_TBB)
|
||||
blender_include_dirs(${TBB_INCLUDE_DIRS})
|
||||
if(NOT APPLE)
|
||||
# APPLE platform uses full paths for linking libraries.
|
||||
link_directories(${LIBDIR}/tbb/lib)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
|
|
|
@ -44,7 +44,6 @@ else()
|
|||
endif()
|
||||
|
||||
# This builds `bin/tests/blender_test`, but does not add it as a single test.
|
||||
setup_libdirs()
|
||||
BLENDER_SRC_GTEST_EX(
|
||||
NAME blender
|
||||
SRC "${SRC}"
|
||||
|
|
Loading…
Reference in New Issue