eff9e2f4ce
This is the minimal change required to start using modern CMake in the blender build system. This change is designed to allow small incremental changes to the build system rather than doing it in one big bang which would be unmaintainable (for me) The biggest functional change is, previously all libraries in the `LIB` section of a `blender_add_lib` call had the `INTERFACE` scope, which is rarely, if ever the correct scope. This diff changes this to `PRIVATE` Concrete implications of this diff : The `LIB`, `INC` and `INC_SYS` sections of an `blender_add_lib` call now allow scoping keywords (`PUBLIC`, `PRIVATE,` `INTERFACE`) to declare the scope of the dependency. Right now the only library using any modern cmake is `bf_intern_atomic` which is an header only interface library that will just advertise its include directories. This allows us to clean up any `CMakeLists.txt` that adds `../../../intern/atomic` to its `INC` section to remove it in `INC` by adding a `PRIVATE bf_intern_atomic` to the `LIB` section. Pull Request: https://projects.blender.org/blender/blender/pulls/107858
61 lines
1.3 KiB
CMake
61 lines
1.3 KiB
CMake
# SPDX-FileCopyrightText: 2011-2022 Blender Foundation
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
if(WITH_GTESTS AND WITH_CYCLES_LOGGING)
|
|
Include(GTestTesting)
|
|
|
|
# Otherwise we get warnings here that we can't fix in external projects
|
|
remove_strict_flags()
|
|
endif()
|
|
|
|
set(INC
|
|
..
|
|
)
|
|
|
|
set(LIB
|
|
cycles_kernel
|
|
cycles_integrator
|
|
cycles_scene
|
|
cycles_session
|
|
cycles_bvh
|
|
cycles_graph
|
|
cycles_subd
|
|
cycles_device
|
|
cycles_util
|
|
)
|
|
cycles_external_libraries_append(LIB)
|
|
|
|
include_directories(${INC})
|
|
|
|
set(SRC
|
|
integrator_adaptive_sampling_test.cpp
|
|
integrator_render_scheduler_test.cpp
|
|
integrator_tile_test.cpp
|
|
render_graph_finalize_test.cpp
|
|
util_aligned_malloc_test.cpp
|
|
util_math_test.cpp
|
|
util_md5_test.cpp
|
|
util_path_test.cpp
|
|
util_string_test.cpp
|
|
util_task_test.cpp
|
|
util_time_test.cpp
|
|
util_transform_test.cpp
|
|
)
|
|
|
|
# Disable AVX tests on macOS. Rosetta has problems running them, and other
|
|
# platforms should be enough to verify AVX operations are implemented correctly.
|
|
if(NOT APPLE)
|
|
if(CXX_HAS_AVX2)
|
|
list(APPEND SRC
|
|
util_float8_avx2_test.cpp
|
|
)
|
|
set_source_files_properties(util_float8_avx2_test.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_AVX2_KERNEL_FLAGS}")
|
|
endif()
|
|
endif()
|
|
|
|
if(WITH_GTESTS AND WITH_CYCLES_LOGGING)
|
|
set(INC_SYS )
|
|
blender_add_test_executable(cycles "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
|
|
endif()
|