Commit: 47adab4f993e66328bd1ad97abaf6697784ee8a0
Author: Campbell Barton
Date:   Sun Apr 14 15:18:44 2019 +0200
Branches: master
https://developer.blender.org/rB47adab4f993e66328bd1ad97abaf6697784ee8a0

CMake: prepare for BLENDER_SORTED_LIBS removal

No functional change, this adds LIB definition and args to cmake files.
Without this it's difficult to migrate away from 'BLENDER_SORTED_LIBS'
since there are many platforms/configurations that could break when
changing linking order.

Manually add and enable WITHOUT_SORTED_LIBS to try building
without sorted libs (currently fails since all variables are empty).
This check will eventually be removed.

See T46725.

===================================================================

M       build_files/cmake/macros.cmake
M       extern/binreloc/CMakeLists.txt
M       extern/bullet2/CMakeLists.txt
M       extern/ceres/CMakeLists.txt
M       extern/ceres/bundle.sh
M       extern/clew/CMakeLists.txt
M       extern/cuew/CMakeLists.txt
M       extern/curve_fit_nd/CMakeLists.txt
M       extern/draco/dracoenc/CMakeLists.txt
M       extern/gflags/CMakeLists.txt
M       extern/glew-es/CMakeLists.txt
M       extern/glew/CMakeLists.txt
M       extern/glog/CMakeLists.txt
M       extern/gtest/CMakeLists.txt
M       extern/lzma/CMakeLists.txt
M       extern/lzo/CMakeLists.txt
M       extern/rangetree/CMakeLists.txt
M       extern/sdlew/CMakeLists.txt
M       extern/wcwidth/CMakeLists.txt
M       extern/xdnd/CMakeLists.txt
M       intern/audaspace/CMakeLists.txt
M       intern/clog/CMakeLists.txt
M       intern/cycles/blender/CMakeLists.txt
M       intern/dualcon/CMakeLists.txt
M       intern/eigen/CMakeLists.txt
M       intern/elbeem/CMakeLists.txt
M       intern/ghost/CMakeLists.txt
M       intern/glew-mx/CMakeLists.txt
M       intern/guardedalloc/CMakeLists.txt
M       intern/iksolver/CMakeLists.txt
M       intern/itasc/CMakeLists.txt
M       intern/libmv/CMakeLists.txt
M       intern/libmv/bundle.sh
M       intern/locale/CMakeLists.txt
M       intern/memutil/CMakeLists.txt
M       intern/mikktspace/CMakeLists.txt
M       intern/numaapi/CMakeLists.txt
M       intern/opencolorio/CMakeLists.txt
M       intern/opensubdiv/CMakeLists.txt
M       intern/openvdb/CMakeLists.txt
M       intern/rigidbody/CMakeLists.txt
M       intern/smoke/CMakeLists.txt
M       intern/string/CMakeLists.txt
M       intern/utfconv/CMakeLists.txt
M       source/blender/alembic/CMakeLists.txt
M       source/blender/avi/CMakeLists.txt
M       source/blender/blenfont/CMakeLists.txt
M       source/blender/blenkernel/CMakeLists.txt
M       source/blender/blenlib/CMakeLists.txt
M       source/blender/blenloader/CMakeLists.txt
M       source/blender/blentranslation/CMakeLists.txt
M       source/blender/bmesh/CMakeLists.txt
M       source/blender/collada/CMakeLists.txt
M       source/blender/compositor/CMakeLists.txt
M       source/blender/depsgraph/CMakeLists.txt
M       source/blender/draw/CMakeLists.txt
M       source/blender/editors/animation/CMakeLists.txt
M       source/blender/editors/armature/CMakeLists.txt
M       source/blender/editors/curve/CMakeLists.txt
M       source/blender/editors/datafiles/CMakeLists.txt
M       source/blender/editors/gizmo_library/CMakeLists.txt
M       source/blender/editors/gpencil/CMakeLists.txt
M       source/blender/editors/interface/CMakeLists.txt
M       source/blender/editors/io/CMakeLists.txt
M       source/blender/editors/lattice/CMakeLists.txt
M       source/blender/editors/mask/CMakeLists.txt
M       source/blender/editors/mesh/CMakeLists.txt
M       source/blender/editors/metaball/CMakeLists.txt
M       source/blender/editors/object/CMakeLists.txt
M       source/blender/editors/physics/CMakeLists.txt
M       source/blender/editors/render/CMakeLists.txt
M       source/blender/editors/scene/CMakeLists.txt
M       source/blender/editors/screen/CMakeLists.txt
M       source/blender/editors/sculpt_paint/CMakeLists.txt
M       source/blender/editors/sound/CMakeLists.txt
M       source/blender/editors/space_action/CMakeLists.txt
M       source/blender/editors/space_api/CMakeLists.txt
M       source/blender/editors/space_buttons/CMakeLists.txt
M       source/blender/editors/space_clip/CMakeLists.txt
M       source/blender/editors/space_console/CMakeLists.txt
M       source/blender/editors/space_file/CMakeLists.txt
M       source/blender/editors/space_graph/CMakeLists.txt
M       source/blender/editors/space_image/CMakeLists.txt
M       source/blender/editors/space_info/CMakeLists.txt
M       source/blender/editors/space_nla/CMakeLists.txt
M       source/blender/editors/space_node/CMakeLists.txt
M       source/blender/editors/space_outliner/CMakeLists.txt
M       source/blender/editors/space_script/CMakeLists.txt
M       source/blender/editors/space_sequencer/CMakeLists.txt
M       source/blender/editors/space_statusbar/CMakeLists.txt
M       source/blender/editors/space_text/CMakeLists.txt
M       source/blender/editors/space_topbar/CMakeLists.txt
M       source/blender/editors/space_userpref/CMakeLists.txt
M       source/blender/editors/space_view3d/CMakeLists.txt
M       source/blender/editors/transform/CMakeLists.txt
M       source/blender/editors/undo/CMakeLists.txt
M       source/blender/editors/util/CMakeLists.txt
M       source/blender/editors/uvedit/CMakeLists.txt
M       source/blender/freestyle/CMakeLists.txt
M       source/blender/gpencil_modifiers/CMakeLists.txt
M       source/blender/gpu/CMakeLists.txt
M       source/blender/ikplugin/CMakeLists.txt
M       source/blender/imbuf/CMakeLists.txt
M       source/blender/imbuf/intern/cineon/CMakeLists.txt
M       source/blender/imbuf/intern/dds/CMakeLists.txt
M       source/blender/imbuf/intern/oiio/CMakeLists.txt
M       source/blender/imbuf/intern/openexr/CMakeLists.txt
M       source/blender/makesdna/intern/CMakeLists.txt
M       source/blender/makesrna/intern/CMakeLists.txt
M       source/blender/modifiers/CMakeLists.txt
M       source/blender/nodes/CMakeLists.txt
M       source/blender/physics/CMakeLists.txt
M       source/blender/python/bmesh/CMakeLists.txt
M       source/blender/python/generic/CMakeLists.txt
M       source/blender/python/gpu/CMakeLists.txt
M       source/blender/python/intern/CMakeLists.txt
M       source/blender/python/mathutils/CMakeLists.txt
M       source/blender/render/CMakeLists.txt
M       source/blender/shader_fx/CMakeLists.txt
M       source/blender/windowmanager/CMakeLists.txt
M       source/creator/CMakeLists.txt
M       tests/gtests/testing/CMakeLists.txt

===================================================================

diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index 9d1baaa24fd..c4ae75db9d7 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -222,6 +222,7 @@ function(blender_add_lib__impl
        sources
        includes
        includes_sys
+       libraries
        )
 
        # message(STATUS "Configuring library ${name}")
@@ -233,6 +234,11 @@ function(blender_add_lib__impl
 
        add_library(${name} ${sources})
 
+       # Use for testing 'BLENDER_SORTED_LIBS' removal.
+       if(DEFINED WITHOUT_SORTED_LIBS AND WITHOUT_SORTED_LIBS)
+               target_link_libraries(${name} "${libraries}")
+       endif()
+
        # works fine without having the includes
        # listed is helpful for IDE's (QtCreator/MSVC)
        blender_source_group("${sources}")
@@ -257,11 +263,12 @@ function(blender_add_lib_nolist
        sources
        includes
        includes_sys
+       libraries
        )
 
        add_cc_flags_custom_test(${name} PARENT_SCOPE)
 
-       blender_add_lib__impl(${name} "${sources}" "${includes}" 
"${includes_sys}")
+       blender_add_lib__impl(${name} "${sources}" "${includes}" 
"${includes_sys}" "${libraries}")
 endfunction()
 
 function(blender_add_lib
@@ -269,11 +276,12 @@ function(blender_add_lib
        sources
        includes
        includes_sys
+       libraries
        )
 
        add_cc_flags_custom_test(${name} PARENT_SCOPE)
 
-       blender_add_lib__impl(${name} "${sources}" "${includes}" 
"${includes_sys}")
+       blender_add_lib__impl(${name} "${sources}" "${includes}" 
"${includes_sys}" "${libraries}")
 
        set_property(GLOBAL APPEND PROPERTY BLENDER_LINK_LIBS ${name})
 endfunction()
diff --git a/extern/binreloc/CMakeLists.txt b/extern/binreloc/CMakeLists.txt
index 524b884450c..766939b4228 100644
--- a/extern/binreloc/CMakeLists.txt
+++ b/extern/binreloc/CMakeLists.txt
@@ -32,7 +32,10 @@ set(SRC
        include/binreloc.h
 )
 
+set(LIB
+)
+
 add_definitions(-DENABLE_BINRELOC)
 
 
-blender_add_lib(extern_binreloc "${SRC}" "${INC}" "${INC_SYS}")
+blender_add_lib(extern_binreloc "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
diff --git a/extern/bullet2/CMakeLists.txt b/extern/bullet2/CMakeLists.txt
index 7a19b553fdb..b9c21bd831f 100644
--- a/extern/bullet2/CMakeLists.txt
+++ b/extern/bullet2/CMakeLists.txt
@@ -407,9 +407,12 @@ set(SRC
        src/Bullet-C-Api.h
 )
 
+set(LIB
+)
+
 if(CMAKE_COMPILER_IS_GNUCXX)
        # needed for gcc 4.6+
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")
 endif()
 
-blender_add_lib(extern_bullet "${SRC}" "${INC}" "${INC_SYS}")
+blender_add_lib(extern_bullet "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
diff --git a/extern/ceres/CMakeLists.txt b/extern/ceres/CMakeLists.txt
index 3a9ade5510a..0531eb71ba5 100644
--- a/extern/ceres/CMakeLists.txt
+++ b/extern/ceres/CMakeLists.txt
@@ -319,4 +319,4 @@ if(WITH_OPENMP)
        )
 endif()
 
-blender_add_lib(extern_ceres "${SRC}" "${INC}" "${INC_SYS}")
+blender_add_lib(extern_ceres "${SRC}" "${INC}" "${INC_SYS}" "")
diff --git a/extern/ceres/bundle.sh b/extern/ceres/bundle.sh
index 1c9a2e729e5..e8212aa1d41 100755
--- a/extern/ceres/bundle.sh
+++ b/extern/ceres/bundle.sh
@@ -165,5 +165,5 @@ if(WITH_OPENMP)
        )
 endif()
 
-blender_add_lib(extern_ceres "\${SRC}" "\${INC}" "\${INC_SYS}")
+blender_add_lib(extern_ceres "\${SRC}" "\${INC}" "\${INC_SYS}" "")
 EOF
diff --git a/extern/clew/CMakeLists.txt b/extern/clew/CMakeLists.txt
index 940db3d7194..806771cb7f4 100644
--- a/extern/clew/CMakeLists.txt
+++ b/extern/clew/CMakeLists.txt
@@ -32,6 +32,9 @@ set(SRC
        src/clew.c
 )
 
+set(LIB
+)
+
 add_definitions(-DCL_USE_DEPRECATED_OPENCL_1_1_APIS)
 
-blender_add_lib(extern_clew "${SRC}" "${INC}" "${INC_SYS}")
+blender_add_lib(extern_clew "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
diff --git a/extern/cuew/CMakeLists.txt b/extern/cuew/CMakeLists.txt
index 1fc5c8f6978..45d10e29799 100644
--- a/extern/cuew/CMakeLists.txt
+++ b/extern/cuew/CMakeLists.txt
@@ -33,4 +33,7 @@ set(SRC
        include/cuew.h
 )
 
-blender_add_lib(extern_cuew "${SRC}" "${INC}" "${INC_SYS}")
+set(LIB
+)
+
+blender_add_lib(extern_cuew "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
diff --git a/extern/curve_fit_nd/CMakeLists.txt 
b/extern/curve_fit_nd/CMakeLists.txt
index cc9efe1c470..f9264f9b890 100644
--- a/extern/curve_fit_nd/CMakeLists.txt
+++ b/extern/curve_fit_nd/CMakeLists.txt
@@ -36,4 +36,7 @@ set(SRC
        intern/generic_heap.h
 )
 
-blender_add_lib(extern_curve_fit_nd "${SRC}" "${INC}" "${INC_SYS}")
+set(LIB
+)
+
+blender_add_lib(extern_curve_fit_nd "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
diff --git a/extern/draco/dracoenc/CMakeLists.txt 
b/extern/draco/dracoenc/CMakeLists.txt
index 8deb21ece83..04f54ab9293 100644
--- a/extern/draco/dracoenc/CMakeLists.txt
+++ b/extern/draco/dracoenc/CMakeLists.txt
@@ -178,8 +178,11 @@ set(SRC
        src/draco/point_cloud/point_cloud.h
 )
 
+set(LIB
+)
+
 set(INC
        src
 )
 
-blender_add_lib(dracoenc "${SRC}" "${INC}" "")
+blender_add_lib(dracoenc "${SRC}" "${INC}" "" "${LIB}")
diff --git a/extern/gflags/CMakeLists.txt b/extern/gflags/CMakeLists.txt
index da24e5504a3..13c3a2a03a9 100644
--- a/extern/gflags/CMakeLists.txt
+++ b/extern/gflags/CMakeLists.txt
@@ -40,6 +40,9 @@ set(SRC
        src/util.h
 )
 
+set(LIB
+)
+
 if(WIN32)
        list(APPEND SRC
                src/windows_port.cc
@@ -49,4 +52,4 @@ endif()
 
 add_definitions(${GFLAGS_DEFINES})
 
-blender_add_lib(extern_gflags "${SRC}" "${INC}" "${INC_SYS}")
+blender_add_lib(extern_gflags "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
diff --git a/extern/glew-es/CMakeLists.txt b/extern/glew-es/CMakeLists.txt
index 8f14855bf4f..5bb46d3f653 100644
--- a/extern/glew-es/CMakeLists.txt
+++ b/extern/glew-es/CMakeLists.txt
@@ -42,6 +42,9 @@ set(SRC
        include/GL/wglew.h
 )
 
+set(LIB
+)
+
 add_definitions(${GL_DEFINITIONS})
 
-blender_add_lib(extern_glew_es "${SRC}" "${INC}" "${INC_SYS}")
+blender_add_lib(extern_glew_es "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
diff --git a/extern/glew/CMakeLists.txt b/extern/glew/CMakeLists.txt
index 47d38586d1a..b84b0a30199 100644
--- a/extern/glew/CMakeLists.txt
+++ b/extern/glew/CMakeLists.txt
@@ -41,6 +41,9 @@ set(SRC
        include/GL/wglew.h
 )
 
+set(LIB
+)
+
 add_definitions(${GL_DEFINITIONS})
 
-blender_add_lib(extern_glew "${SRC}" "${INC}" "${INC_SYS}")
+blender_add_lib(extern_glew "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
diff --git a/extern/glog/CMakeLists.txt b/extern/glog/CMakeLists.txt
index 82b415d06d7..1b1abbfc735 100644
--- a/extern/glog/CMakeLists.txt
+++ b/extern/glog/CMakeLists.txt
@@ -53,6 +53,9 @@ set(SRC
        src/stacktrace_x86-inl.h
 )
 
+set(LIB
+)
+
 if(WIN32)
        list(APPEND SRC
                src/windows/port.cc
@@ -90,4 +93,4 @@ endif()
 add_definitions(${GFLAGS_DEFINES})
 add_definitions(${GLOG_DEFINES})
 
-blender_add_lib(extern_glog "${SRC}" "${INC}" "${INC_SYS}")
+blender_add_lib(extern_glog "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
diff --git a/extern/gtest/CMakeLists.txt b/extern/gtest/CMakeLists.txt
index 22b47e76b12..f33e012b0f4 100644
--- a/extern/gtest/CMakeLists.txt
+++ b/extern/gtest/CMakeLists.txt
@@ -66,4 +66,7 @@ set(SRC
        include/gtest/internal/gtest-type-util.h
 )
 
-blender_add_lib(extern_gtest "${SRC}" "${INC}" "${INC_SYS}")
+set(LIB
+)
+
+blender_add_lib(extern_gtest "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
diff --git a/extern/lzma/CMakeLists.txt b/extern/lzma/CMakeLists.txt
index d4fe8ade9ba..8be848f83ce 100644
--- a/extern/lzma/CMakeLists.txt
+++ b/extern/lzma/CMakeLists.txt
@@ -42,4 +42,7 @@ set(SRC
        Types.h
 )
 
-blender_add_lib(extern_lzma "${SRC}" "${INC}" "${INC_SYS}")
+set(LIB
+)
+
+blender_add_lib(extern_lzma "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
diff --git a/extern/lzo/CMakeLists.txt b/extern/lzo/CMakeLists.txt
index e4609963d29..7eebc92c46d 100644
--- a/extern/lzo/CMakeLists.txt
+++ b/extern/lzo/CMakeLists.txt
@@ -36,4 +36,7 @@ set(SRC
        minilzo/minilzo.h
 )
 
-blender_add_lib(extern_minilzo "${SRC}" "${INC}" "${INC_SYS}")
+set(LIB
+)
+
+blender_add_lib(extern_minilzo "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
diff --git a/extern/rangetree/CMakeLists.txt b/extern/rangetree/CMakeLists.txt
index 77c293e851a..cb0b424a023 100644
--- a/extern/rangetree/CMakeLists.txt
+++ b/extern/rangetree/CMakeLists.txt
@@ -27,4 +27,7 @@ set(SRC
        intern/range_tree.c
 )
 
-blender_add_lib(extern_rangetree "${SRC}" "${INC}" "")
+set(LIB
+)
+
+blender_add_lib(extern_rangetree "${SRC}" "${INC}" "" "${LIB}")
diff --git a/extern/sdlew/CMakeLists.txt b/extern/sdlew/CMakeLists.txt
index c0cd9944755..5698d87108b 100644
--- a/extern/sdlew/CMakeLists.txt
+++ b/extern/sdlew/CMakeLists.txt
@@ -32,4 +32,7 @@ set(SRC
        src/sdlew.c
 )
 
-blender_add_lib(extern_sdlew "${SRC}" "${INC}" "${INC_SYS}")
+set(LIB
+)
+
+blender_add_lib(extern_sdlew "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
diff --git a/extern/wcwidth/CMakeLists.txt b/extern/wcwidth/CMakeLists.txt
index 29a2977c3eb..384a2c4f58c 100644
--- a/extern/wcwidth/CMakeLists.txt
+++ b/extern/wcwidth/CMakeLists.txt
@@ -32,4 +32,7 @@ set(SRC
        wcwidth.h
 )
 
-blender_add_lib(extern_wcwidth "${SRC}" "${INC}" "${INC_SYS}")
+set(LIB
+)
+
+blender_add_lib(extern_wcwidth "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
diff --git a/extern/xdnd/CMakeLists.txt b/extern/xdnd/CMakeLists.txt
index 9a24606d133..54d6648c2a6 100644
--- a/extern/xdnd/CMakeLists.txt
+++ b/extern/xdnd/CMakeLists.txt
@@ -31,8 +31,11 @@ set(SRC
        xdnd.h
 )
 
+set(LIB
+)
+
 add_definitions(
        -DHAVE_SYS_TIME_H
 )
 
-blender_add_lib(extern_xdnd "${SRC}" "${INC}" "${INC_SYS}")
+blender_add_lib(extern_xdnd "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
diff --git a/intern/audaspace/CMakeLists.txt b/intern/audaspace/CMakeLists.txt
index e359a631532..6b828b204f1 100644
--- a/intern/audaspace/CMakeLists.txt
+++ b/intern/audaspace/CMakeLists.txt
@@ -38,6 +38,9 @@ endif()
                intern/AUD_Set.h
        )
 
+set(LIB
+)
+
 if(WITH_PYTHON)
        list(APPEND INC_SYS
                ${PYTHON_INCLUDE_DIRS}
@@ -49,4 +52,4 @@ if(WITH_PYTHON)
        add_definitions(-DWITH_PYTHON)
 endif()
 
-blender_add_lib(bf_intern_audaspace "${SRC}" "${INC}" "${INC_SYS}")
+blender_add_lib(bf_intern_audaspace "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
diff --git a/intern/clog/CMakeLists.txt b/intern/clog/CMakeLists.txt
index 479723c4cd6..3ca9094dae6 100644
--- a/intern/clog/CMakeLists.txt
+++ b/intern/clog/CMakeLists.txt
@@ -32,7 +32,10 @@ set(SRC
        CLG_log.h
 )
 
+set(LIB
+)
+
 # Disabled for makesdna/makesrna.
 add_definitions(-DWITH_CLOG_PTHREADS)
 
-blender_add_lib(bf_intern_clog "${SRC}" "${INC}" "${INC_SYS}")
+blender_add_lib(bf_in

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to