[Bf-blender-cvs] [2d618bc959c] temp-cmake-without-sorted-libs: Cycles now works
Campbell Barton
noreply at git.blender.org
Mon Apr 15 20:12:34 CEST 2019
Commit: 2d618bc959cb0f98c4fa82bf686a3be32d265fbd
Author: Campbell Barton
Date: Mon Apr 15 15:33:27 2019 +0200
Branches: temp-cmake-without-sorted-libs
https://developer.blender.org/rB2d618bc959cb0f98c4fa82bf686a3be32d265fbd
Cycles now works
===================================================================
M build_files/cmake/macros.cmake
M intern/cycles/bvh/CMakeLists.txt
M intern/cycles/cmake/macros.cmake
M intern/cycles/device/CMakeLists.txt
M intern/cycles/graph/CMakeLists.txt
M intern/cycles/kernel/CMakeLists.txt
M intern/cycles/kernel/osl/CMakeLists.txt
M intern/cycles/render/CMakeLists.txt
M intern/cycles/subd/CMakeLists.txt
M intern/cycles/util/CMakeLists.txt
===================================================================
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index 3947f087105..5dde5aca9f9 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -222,7 +222,7 @@ function(blender_add_lib__impl
sources
includes
includes_sys
- libraries
+ library_dependencies
)
# message(STATUS "Configuring library ${name}")
@@ -236,8 +236,8 @@ function(blender_add_lib__impl
# Use for testing 'BLENDER_SORTED_LIBS' removal.
if(DEFINED WITHOUT_SORTED_LIBS AND WITHOUT_SORTED_LIBS)
- if (NOT "${libraries}" STREQUAL "")
- target_link_libraries(${name} "${libraries}")
+ if (NOT "${library_dependencies}" STREQUAL "")
+ target_link_libraries(${name} "${library_dependencies}")
endif()
endif()
@@ -265,12 +265,12 @@ function(blender_add_lib_nolist
sources
includes
includes_sys
- libraries
+ library_dependencies
)
add_cc_flags_custom_test(${name} PARENT_SCOPE)
- blender_add_lib__impl(${name} "${sources}" "${includes}" "${includes_sys}" "${libraries}")
+ blender_add_lib__impl(${name} "${sources}" "${includes}" "${includes_sys}" "${library_dependencies}")
endfunction()
function(blender_add_lib
@@ -278,12 +278,12 @@ function(blender_add_lib
sources
includes
includes_sys
- libraries
+ library_dependencies
)
add_cc_flags_custom_test(${name} PARENT_SCOPE)
- blender_add_lib__impl(${name} "${sources}" "${includes}" "${includes_sys}" "${libraries}")
+ blender_add_lib__impl(${name} "${sources}" "${includes}" "${includes_sys}" "${library_dependencies}")
set_property(GLOBAL APPEND PROPERTY BLENDER_LINK_LIBS ${name})
endfunction()
diff --git a/intern/cycles/bvh/CMakeLists.txt b/intern/cycles/bvh/CMakeLists.txt
index 6014624f395..ea31838d816 100644
--- a/intern/cycles/bvh/CMakeLists.txt
+++ b/intern/cycles/bvh/CMakeLists.txt
@@ -35,7 +35,11 @@ set(SRC_HEADERS
bvh_unaligned.h
)
+set(LIB
+ cycles_render
+)
+
include_directories(${INC})
include_directories(SYSTEM ${INC_SYS})
-cycles_add_library(cycles_bvh ${SRC} ${SRC_HEADERS})
+cycles_add_library(cycles_bvh "${LIB}" ${SRC} ${SRC_HEADERS})
diff --git a/intern/cycles/cmake/macros.cmake b/intern/cycles/cmake/macros.cmake
index f3ca06ac6b8..2f584576740 100644
--- a/intern/cycles/cmake/macros.cmake
+++ b/intern/cycles/cmake/macros.cmake
@@ -6,7 +6,12 @@ function(cycles_set_solution_folder target)
endif()
endfunction()
-macro(cycles_add_library target)
+macro(cycles_add_library target library_dependencies)
add_library(${target} ${ARGN})
+ if(DEFINED WITHOUT_SORTED_LIBS AND WITHOUT_SORTED_LIBS)
+ if(NOT ("${library_dependencies}" STREQUAL ""))
+ target_link_libraries(${target} "${library_dependencies}")
+ endif()
+ endif()
cycles_set_solution_folder(${target})
endmacro()
diff --git a/intern/cycles/device/CMakeLists.txt b/intern/cycles/device/CMakeLists.txt
index d95cd02a85e..d804a07bcab 100644
--- a/intern/cycles/device/CMakeLists.txt
+++ b/intern/cycles/device/CMakeLists.txt
@@ -58,6 +58,20 @@ set(SRC_HEADERS
device_task.h
)
+set(LIB
+
+)
+
+if(WITH_CUDA_DYNLOAD)
+ list(APPEND LIB
+ extern_cuew
+ )
+else()
+ list(APPEND LIB
+ ${CUDA_CUDA_LIBRARY}
+ )
+endif()
+
add_definitions(${GL_DEFINITIONS})
if(WITH_CYCLES_NETWORK)
add_definitions(-DWITH_NETWORK)
@@ -75,4 +89,4 @@ endif()
include_directories(${INC})
include_directories(SYSTEM ${INC_SYS})
-cycles_add_library(cycles_device ${SRC} ${SRC_OPENCL} ${SRC_HEADERS})
+cycles_add_library(cycles_device "${LIB}" ${SRC} ${SRC_OPENCL} ${SRC_HEADERS})
diff --git a/intern/cycles/graph/CMakeLists.txt b/intern/cycles/graph/CMakeLists.txt
index 0ce56c2b2e6..bd2b2728a29 100644
--- a/intern/cycles/graph/CMakeLists.txt
+++ b/intern/cycles/graph/CMakeLists.txt
@@ -16,7 +16,11 @@ set(SRC_HEADERS
node_xml.h
)
+set(LIB
+
+)
+
include_directories(${INC})
include_directories(SYSTEM ${INC_SYS})
-cycles_add_library(cycles_graph ${SRC} ${SRC_HEADERS})
+cycles_add_library(cycles_graph "${LIB}" ${SRC} ${SRC_HEADERS})
diff --git a/intern/cycles/kernel/CMakeLists.txt b/intern/cycles/kernel/CMakeLists.txt
index 822ce68bdc8..cbb69962781 100644
--- a/intern/cycles/kernel/CMakeLists.txt
+++ b/intern/cycles/kernel/CMakeLists.txt
@@ -333,6 +333,10 @@ set(SRC_SPLIT_HEADERS
split/kernel_subsurface_scatter.h
)
+set(LIB
+
+)
+
# CUDA module
if(WITH_CYCLES_CUDA_BINARIES)
@@ -507,7 +511,7 @@ if(CXX_HAS_AVX2)
set_source_files_properties(kernels/cpu/filter_avx2.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_AVX2_KERNEL_FLAGS}")
endif()
-cycles_add_library(cycles_kernel
+cycles_add_library(cycles_kernel "${LIB}"
${SRC_CPU_KERNELS}
${SRC_CUDA_KERNELS}
${SRC_OPENCL_KERNELS}
diff --git a/intern/cycles/kernel/osl/CMakeLists.txt b/intern/cycles/kernel/osl/CMakeLists.txt
index adca45c5c76..0a3d0b974cb 100644
--- a/intern/cycles/kernel/osl/CMakeLists.txt
+++ b/intern/cycles/kernel/osl/CMakeLists.txt
@@ -25,9 +25,13 @@ set(HEADER_SRC
osl_shader.h
)
+set(LIB
+ cycles_render
+)
+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${RTTI_DISABLE_FLAGS}")
include_directories(${INC})
include_directories(SYSTEM ${INC_SYS})
-cycles_add_library(cycles_kernel_osl ${SRC} ${HEADER_SRC})
+cycles_add_library(cycles_kernel_osl "${LIB}" ${SRC} ${HEADER_SRC})
diff --git a/intern/cycles/render/CMakeLists.txt b/intern/cycles/render/CMakeLists.txt
index b7c53f17c3d..6a02463d651 100644
--- a/intern/cycles/render/CMakeLists.txt
+++ b/intern/cycles/render/CMakeLists.txt
@@ -73,6 +73,10 @@ set(SRC_HEADERS
tile.h
)
+set(LIB
+ cycles_bvh
+)
+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${RTTI_DISABLE_FLAGS}")
include_directories(${INC})
@@ -80,4 +84,4 @@ include_directories(SYSTEM ${INC_SYS})
add_definitions(${GL_DEFINITIONS})
-cycles_add_library(cycles_render ${SRC} ${SRC_HEADERS})
+cycles_add_library(cycles_render "${LIB}" ${SRC} ${SRC_HEADERS})
diff --git a/intern/cycles/subd/CMakeLists.txt b/intern/cycles/subd/CMakeLists.txt
index 7f952dd43ce..9669bdede7e 100644
--- a/intern/cycles/subd/CMakeLists.txt
+++ b/intern/cycles/subd/CMakeLists.txt
@@ -21,7 +21,11 @@ set(SRC_HEADERS
subd_split.h
)
+set(LIB
+
+)
+
include_directories(${INC})
include_directories(SYSTEM ${INC_SYS})
-cycles_add_library(cycles_subd ${SRC} ${SRC_HEADERS})
+cycles_add_library(cycles_subd "${LIB}" ${SRC} ${SRC_HEADERS})
diff --git a/intern/cycles/util/CMakeLists.txt b/intern/cycles/util/CMakeLists.txt
index 16abed142b2..6f498664382 100644
--- a/intern/cycles/util/CMakeLists.txt
+++ b/intern/cycles/util/CMakeLists.txt
@@ -146,4 +146,4 @@ include_directories(SYSTEM ${INC_SYS})
add_definitions(${GL_DEFINITIONS})
-cycles_add_library(cycles_util ${SRC} ${SRC_HEADERS})
+cycles_add_library(cycles_util "${LIB}" ${SRC} ${SRC_HEADERS})
More information about the Bf-blender-cvs
mailing list