Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnkit Meel <ankitjmeel@gmail.com>2020-10-08 17:01:40 +0300
committerAnkit Meel <ankitjmeel@gmail.com>2020-10-09 17:11:58 +0300
commit1f6b7387ad0177c1dec9bb83b7c7586a454691db (patch)
tree06ef0230baef76f1bdee3226e128bf03453c44b5 /source/blender/datatoc
parent83e91485d096e64e9cfa45e19292dd76378abe73 (diff)
CMake/macOS: Remove _LIBPATH, avoid link_directories.
After tests were bundled in a single executable and cycles and libmv created their own tests, the warnings on macOS have gone over 800. The reason is setting `*_LIBRARIES` to names of the libraries and later using `link_directories` to link them properly. https://cmake.org/cmake/help/latest/command/link_directories.html > Note This command is rarely necessary and should be avoided where > there are other choices. Prefer to pass full absolute paths to > libraries where possible, since this ensures the correct library > will always be linked. The find_library() command provides the > full path, which can generally be used directly in calls to > target_link_libraries(). Warnings like the following popup for every target/executable, for every library it links to. ``` ld: warning: directory not found for option '-L/Users/me/blender-build/blender/../lib/darwin/jpeg/lib/Debug' ``` The patch completes a step towards removing `link_directories` as mentioned in TODO at several places. The patch uses absolute paths to link libraries and removes all `*_LIBPATH`s except `PYTHON_LIBPATH` from `platform_apple.cmake` file. (The corner case where it's used seems like dead code. Python is no longer shipped with that file structure.) Also, unused code for LLVM-3.4 has been removed. Also, guards to avoid searching libraries in system directories have been added. `APPLE` platform now no longer needs `setup_libdirs`, `cycles_link_directories`, and `link_directories`. The number of warnings now is less than 100, most of them being deprecation ones in dependencies. This patch depended on {rBb746179d0add}, {rB2fdbe4d05011}, {rB402a4cadba49} and {rBd7f482f88ecb}. Reviewed By: brecht Differential Revision: https://developer.blender.org/D8855
Diffstat (limited to 'source/blender/datatoc')
-rw-r--r--source/blender/datatoc/CMakeLists.txt5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/datatoc/CMakeLists.txt b/source/blender/datatoc/CMakeLists.txt
index 3dc4a1add76..fa400ccf36d 100644
--- a/source/blender/datatoc/CMakeLists.txt
+++ b/source/blender/datatoc/CMakeLists.txt
@@ -52,7 +52,10 @@ if(NOT WITH_HEADLESS)
endif()
include_directories(${PNG_INCLUDE_DIRS})
- link_directories(${PNG_LIBPATH} ${ZLIB_LIBPATH})
+ if(NOT APPLE)
+ # APPLE plaform uses full paths for linking libraries.
+ link_directories(${PNG_LIBPATH} ${ZLIB_LIBPATH})
+ endif(NOT APPLE)
add_executable(datatoc_icon ${SRC})
setup_platform_linker_flags(datatoc_icon)