CMake: quiet references to undeclared variable warnings

These warnings can reveal errors in logic, so quiet them by checking
if the features are enabled before using variables or by assigning
empty strings in some cases.

- Check CMAKE_THREAD_LIBS_INIT is set before use as CMake docs
  note that this may be left unset if it's not needed.
- Remove BOOST/OPENVDB/VULKAN references when disable.
- Define INC_SYS even when empty.
- Remove PNG_INC from freetype (not defined anywhere).
This commit is contained in:
Campbell Barton 2023-01-19 17:07:23 +11:00
parent 8b7d2d8eb2
commit 66dee44088
62 changed files with 325 additions and 142 deletions

View File

@ -993,6 +993,8 @@ set(PLATFORM_LINKLIBS "")
# - CMAKE_EXE_LINKER_FLAGS_DEBUG
set(PLATFORM_LINKFLAGS "")
set(PLATFORM_LINKFLAGS_DEBUG "")
set(PLATFORM_LINKFLAGS_RELEASE "")
set(PLATFORM_LINKFLAGS_EXECUTABLE "")
if(NOT CMAKE_BUILD_TYPE MATCHES "Release")
if(WITH_COMPILER_ASAN)

View File

@ -17,9 +17,13 @@ ENDIF()
SET(_optix_SEARCH_DIRS
${OPTIX_ROOT_DIR}
"$ENV{PROGRAMDATA}/NVIDIA Corporation/OptiX SDK 7.3.0"
)
# TODO: Which environment uses this?
if(DEFINED ENV{PROGRAMDATA})
list(APPEND _optix_SEARCH_DIRS "$ENV{PROGRAMDATA}/NVIDIA Corporation/OptiX SDK 7.3.0")
endif()
FIND_PATH(OPTIX_INCLUDE_DIR
NAMES
optix.h

View File

@ -67,6 +67,8 @@ ENDIF()
STRING(REPLACE "." "" PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION})
SET(_PYTHON_ABI_FLAGS "")
SET(_python_SEARCH_DIRS
${PYTHON_ROOT_DIR}
"$ENV{HOME}/py${PYTHON_VERSION_NO_DOTS}"

View File

@ -550,7 +550,9 @@ function(setup_platform_linker_libs
endif()
if(WIN32 AND NOT UNIX)
target_link_libraries(${target} ${PTHREADS_LIBRARIES})
if(DEFINED PTHREADS_LIBRARIES)
target_link_libraries(${target} ${PTHREADS_LIBRARIES})
endif()
endif()
# target_link_libraries(${target} ${PLATFORM_LINKLIBS} ${CMAKE_DL_LIBS})

View File

@ -430,10 +430,13 @@ if(WITH_OPENIMAGEIO)
${PNG_LIBRARIES}
${JPEG_LIBRARIES}
${ZLIB_LIBRARIES}
${BOOST_LIBRARIES}
)
set(OPENIMAGEIO_DEFINITIONS "")
if(WITH_BOOST)
list(APPEND OPENIMAGEIO_LIBRARIES "${BOOST_LIBRARIES}")
endif()
if(WITH_IMAGE_TIFF)
list(APPEND OPENIMAGEIO_LIBRARIES "${TIFF_LIBRARY}")
endif()
@ -451,7 +454,7 @@ add_bundled_libraries(openimageio/lib)
if(WITH_OPENCOLORIO)
find_package_wrapper(OpenColorIO 2.0.0)
set(OPENCOLORIO_DEFINITIONS)
set(OPENCOLORIO_DEFINITIONS "")
set_and_warn_library_found("OpenColorIO" OPENCOLORIO_FOUND WITH_OPENCOLORIO)
endif()
add_bundled_libraries(opencolorio/lib)
@ -551,9 +554,14 @@ else()
endif()
find_package(Threads REQUIRED)
list(APPEND PLATFORM_LINKLIBS ${CMAKE_THREAD_LIBS_INIT})
# used by other platforms
set(PTHREADS_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
# `FindThreads` documentation notes that this may be empty
# with the system libraries provide threading functionality.
if(CMAKE_THREAD_LIBS_INIT)
list(APPEND PLATFORM_LINKLIBS ${CMAKE_THREAD_LIBS_INIT})
# used by other platforms
set(PTHREADS_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
endif()
if(CMAKE_DL_LIBS)
list(APPEND PLATFORM_LINKLIBS ${CMAKE_DL_LIBS})

View File

@ -13,10 +13,12 @@ endif()
# Exporting functions from the blender binary gives linker warnings on Apple arm64 systems.
# Silence them here.
if(APPLE AND ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64"))
if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
string(APPEND CMAKE_C_FLAGS " -fvisibility=hidden")
string(APPEND CMAKE_CXX_FLAGS " -fvisibility=hidden")
if(APPLE)
if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
string(APPEND CMAKE_C_FLAGS " -fvisibility=hidden")
string(APPEND CMAKE_CXX_FLAGS " -fvisibility=hidden")
endif()
endif()
endif()
@ -261,9 +263,11 @@ set(LIB
blender_add_lib(extern_mantaflow "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
# The VDB libs above are only added to as INTERFACE libs by blender_add_lib,
# meaning extern_mantaflow itself actually does not have a dependency on the
# openvdb libraries, and CMAKE is free to link the vdb libs before
# extern_mantaflow causing linker errors on linux. By explicitly declaring
# a dependency here, cmake will do the right thing.
target_link_libraries(extern_mantaflow PRIVATE ${OPENVDB_LIBRARIES})
if(WITH_OPENVDB)
# The VDB libs above are only added to as INTERFACE libs by blender_add_lib,
# meaning extern_mantaflow itself actually does not have a dependency on the
# openvdb libraries, and CMAKE is free to link the vdb libs before
# extern_mantaflow causing linker errors on linux. By explicitly declaring
# a dependency here, cmake will do the right thing.
target_link_libraries(extern_mantaflow PRIVATE ${OPENVDB_LIBRARIES})
endif()

View File

@ -111,8 +111,10 @@ macro(cycles_external_libraries_append libraries)
endif()
if(WITH_OPENIMAGEDENOISE)
list(APPEND ${libraries} ${OPENIMAGEDENOISE_LIBRARIES})
if(APPLE AND "${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
list(APPEND ${libraries} "-framework Accelerate")
if(APPLE)
if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
list(APPEND ${libraries} "-framework Accelerate")
endif()
endif()
endif()
if(WITH_ALEMBIC)
@ -136,7 +138,15 @@ macro(cycles_external_libraries_append libraries)
${PYTHON_LIBRARIES}
${ZLIB_LIBRARIES}
${CMAKE_DL_LIBS}
${PTHREADS_LIBRARIES}
)
if(DEFINED PTHREADS_LIBRARIES)
list(APPEND ${libraries}
${PTHREADS_LIBRARIES}
)
endif()
list(APPEND ${libraries}
${PLATFORM_LINKLIBS}
)

View File

@ -5,6 +5,9 @@ set(INC
..
)
set(INC_SYS
)
set(SRC
node.cpp
node_type.cpp

View File

@ -5,6 +5,9 @@ set(INC
..
)
set(INC_SYS
)
set(SRC
adaptive_sampling.cpp
denoiser.cpp

View File

@ -5,6 +5,9 @@ set(INC
..
)
set(INC_SYS
)
set(SRC
buffers.cpp
denoising.cpp

View File

@ -41,10 +41,11 @@ if(WIN32 AND NOT UNIX)
list(APPEND INC_SYS
${PTHREADS_INC}
)
list(APPEND LIB
${PTHREADS_LIBRARIES}
)
if(DEFINED PTHREADS_LIBRARIES)
list(APPEND LIB
${PTHREADS_LIBRARIES}
)
endif()
endif()
# Jemalloc 5.0.0+ needs extra configuration.

View File

@ -50,5 +50,7 @@ else()
add_executable(blender-thumbnailer ${SRC} ${SRC_CMD})
setup_platform_linker_flags(blender-thumbnailer)
target_link_libraries(blender-thumbnailer bf_blenlib)
target_link_libraries(blender-thumbnailer ${PTHREADS_LIBRARIES})
if(DEFINED PTHREADS_LIBRARIES)
target_link_libraries(blender-thumbnailer ${PTHREADS_LIBRARIES})
endif()
endif()

View File

@ -559,15 +559,16 @@ if(WIN32)
endif()
if(WITH_AUDASPACE)
add_definitions(-DWITH_AUDASPACE)
list(APPEND INC_SYS
${AUDASPACE_C_INCLUDE_DIRS}
)
list(APPEND LIB
${AUDASPACE_C_LIBRARIES}
${AUDASPACE_PY_LIBRARIES}
)
if(WITH_SYSTEM_AUDASPACE)
list(APPEND LIB
${AUDASPACE_C_LIBRARIES}
${AUDASPACE_PY_LIBRARIES}
)
endif()
add_definitions(-DWITH_AUDASPACE)
endif()
if(WITH_BULLET)

View File

@ -16,6 +16,8 @@ set(INC
../../../../intern/guardedalloc
)
set(INC_SYS
)
set(SRC
intern/compile_state.cc

View File

@ -35,7 +35,6 @@ set(INC
# dna_type_offsets.h
${CMAKE_CURRENT_BINARY_DIR}/../makesdna/intern
${OPENSUBDIV_INCLUDE_DIRS}
)
set(SRC
@ -724,6 +723,12 @@ if(WITH_DRAW_DEBUG)
add_definitions(-DWITH_DRAW_DEBUG)
endif()
if(WITH_OPENSUBDIV)
list(APPEND INC_SYS
${OPENSUBDIV_INCLUDE_DIRS}
)
endif()
if(WITH_MOD_FLUID)
list(APPEND INC
../../../intern/mantaflow/extern

View File

@ -17,6 +17,8 @@ set(INC
${CMAKE_BINARY_DIR}/source/blender/makesrna
)
set(INC_SYS
)
set(SRC
anim_channels_defines.c

View File

@ -19,6 +19,9 @@ set(INC
${CMAKE_BINARY_DIR}/source/blender/makesrna
)
set(INC_SYS
)
set(SRC
armature_add.c
armature_edit.c

View File

@ -17,6 +17,9 @@ set(INC
${CMAKE_BINARY_DIR}/source/blender/makesrna
)
set(INC_SYS
)
set(SRC
curve_ops.c
editcurve.c

View File

@ -18,6 +18,9 @@ set(INC
${CMAKE_BINARY_DIR}/source/blender/makesrna
)
set(INC_SYS
)
set(SRC
gizmo_draw_utils.c
gizmo_geometry.h

View File

@ -18,6 +18,9 @@ set(INC
${CMAKE_BINARY_DIR}/source/blender/makesrna
)
set(INC_SYS
)
set(SRC
annotate_draw.c
annotate_paint.c

View File

@ -26,6 +26,9 @@ set(INC
${CMAKE_BINARY_DIR}/source/blender/makesrna
)
set(INC_SYS
)
set(SRC
eyedroppers/eyedropper_color.cc
eyedroppers/eyedropper_colorband.cc

View File

@ -13,6 +13,9 @@ set(INC
../../../../intern/guardedalloc
)
set(INC_SYS
)
set(SRC
mask_add.c
mask_draw.c

View File

@ -29,6 +29,9 @@ set(INC
${CMAKE_BINARY_DIR}/source/blender/makesrna
)
set(INC_SYS
)
set(SRC
object_add.cc
object_bake.c

View File

@ -17,6 +17,9 @@ set(INC
${CMAKE_BINARY_DIR}/source/blender/makesrna
)
set(INC_SYS
)
set(SRC
dynamicpaint_ops.c
particle_boids.c

View File

@ -20,6 +20,9 @@ set(INC
${CMAKE_BINARY_DIR}/source/blender/makesrna
)
set(INC_SYS
)
set(SRC
area.c
area_query.c

View File

@ -30,15 +30,18 @@ set(LIB
)
if(WITH_AUDASPACE)
list(APPEND LIB
bf_intern_audaspace
)
list(APPEND INC_SYS
${AUDASPACE_C_INCLUDE_DIRS}
)
list(APPEND LIB
bf_intern_audaspace
${AUDASPACE_C_LIBRARIES}
${AUDASPACE_PY_LIBRARIES}
)
if(WITH_SYSTEM_AUDASPACE)
list(APPEND LIB
${AUDASPACE_C_LIBRARIES}
${AUDASPACE_PY_LIBRARIES}
)
endif()
add_definitions(-DWITH_AUDASPACE)
endif()

View File

@ -19,6 +19,9 @@ set(INC
${CMAKE_BINARY_DIR}/source/blender/makesrna
)
set(INC_SYS
)
set(SRC
action_buttons.c
action_data.c

View File

@ -19,6 +19,9 @@ set(INC
${CMAKE_BINARY_DIR}/source/blender/makesrna
)
set(INC_SYS
)
set(SRC
buttons_context.c
buttons_ops.c

View File

@ -22,6 +22,9 @@ set(INC
${CMAKE_BINARY_DIR}/source/blender/makesrna
)
set(INC_SYS
)
set(SRC
clip_buttons.c
clip_dopesheet_draw.c

View File

@ -16,6 +16,9 @@ set(INC
${CMAKE_CURRENT_BINARY_DIR}/../../makesdna/intern
)
set(INC_SYS
)
set(SRC
console_draw.c
console_ops.c

View File

@ -24,6 +24,9 @@ set(INC
${CMAKE_BINARY_DIR}/source/blender/makesrna
)
set(INC_SYS
)
set(SRC
asset_catalog_tree_view.cc
file_draw.c

View File

@ -19,6 +19,9 @@ set(INC
${CMAKE_BINARY_DIR}/source/blender/makesrna
)
set(INC_SYS
)
set(SRC
graph_buttons.c
graph_draw.c
@ -39,15 +42,18 @@ set(LIB
)
if(WITH_AUDASPACE)
list(APPEND LIB
bf_intern_audaspace
)
list(APPEND INC_SYS
${AUDASPACE_C_INCLUDE_DIRS}
)
list(APPEND LIB
bf_intern_audaspace
${AUDASPACE_C_LIBRARIES}
${AUDASPACE_PY_LIBRARIES}
)
if(WITH_SYSTEM_AUDASPACE)
list(APPEND LIB
${AUDASPACE_C_LIBRARIES}
${AUDASPACE_PY_LIBRARIES}
)
endif()
add_definitions(-DWITH_AUDASPACE)
endif()

View File

@ -25,6 +25,9 @@ set(INC
${CMAKE_BINARY_DIR}/source/blender/makesrna
)
set(INC_SYS
)
set(SRC
image_buttons.c
image_draw.c

View File

@ -22,6 +22,9 @@ set(INC
${CMAKE_BINARY_DIR}/source/blender/makesrna
)
set(INC_SYS
)
set(SRC
info_draw.c
info_ops.c

View File

@ -19,6 +19,8 @@ set(INC
${CMAKE_BINARY_DIR}/source/blender/makesrna
)
set(INC_SYS
)
set(SRC
nla_buttons.c

View File

@ -22,6 +22,8 @@ set(INC
${CMAKE_BINARY_DIR}/source/blender/makesrna
)
set(INC_SYS
)
set(SRC
outliner_collections.cc

View File

@ -15,6 +15,8 @@ set(INC
${CMAKE_CURRENT_BINARY_DIR}/../../makesdna/intern
)
set(INC_SYS
)
set(SRC
script_edit.c

View File

@ -24,6 +24,8 @@ set(INC
${CMAKE_BINARY_DIR}/source/blender/makesrna
)
set(INC_SYS
)
set(SRC
sequencer_add.c
@ -52,15 +54,16 @@ set(LIB
)
if(WITH_AUDASPACE)
add_definitions(-DWITH_AUDASPACE)
list(APPEND INC_SYS
${AUDASPACE_C_INCLUDE_DIRS}
)
list(APPEND LIB
${AUDASPACE_C_LIBRARIES}
${AUDASPACE_PY_LIBRARIES}
)
if(WITH_SYSTEM_AUDASPACE)
list(APPEND LIB
${AUDASPACE_C_LIBRARIES}
${AUDASPACE_PY_LIBRARIES}
)
endif()
add_definitions(-DWITH_AUDASPACE)
endif()

View File

@ -23,6 +23,9 @@ set(INC
${CMAKE_BINARY_DIR}/source/blender/makesrna
)
set(INC_SYS
)
set(SRC
space_spreadsheet.cc
spreadsheet_cache.cc

View File

@ -18,6 +18,8 @@ set(INC
${CMAKE_BINARY_DIR}/source/blender/makesrna
)
set(INC_SYS
)
set(SRC
space_statusbar.c

View File

@ -17,6 +17,8 @@ set(INC
${CMAKE_CURRENT_BINARY_DIR}/../../makesdna/intern
)
set(INC_SYS
)
set(SRC
space_text.c

View File

@ -18,6 +18,8 @@ set(INC
${CMAKE_BINARY_DIR}/source/blender/makesrna
)
set(INC_SYS
)
set(SRC
space_topbar.c

View File

@ -25,6 +25,8 @@ set(INC
${CMAKE_BINARY_DIR}/source/blender/makesrna
)
set(INC_SYS
)
set(SRC
drawobject.c

View File

@ -19,7 +19,8 @@ set(INC
# RNA_prototypes.h
${CMAKE_BINARY_DIR}/source/blender/makesrna
)
set(INC_SYS
)
set(SRC
transform.c

View File

@ -14,6 +14,9 @@ set(INC
../../bmesh
)
set(INC_SYS
)
set(SRC
ed_undo.c
memfile_undo.c

View File

@ -22,6 +22,8 @@ set(INC
${CMAKE_BINARY_DIR}/source/blender/makesrna
)
set(INC_SYS
)
set(SRC
ed_draw.c

View File

@ -18,6 +18,8 @@ set(INC
${CMAKE_BINARY_DIR}/source/blender/makesrna
)
set(INC_SYS
)
set(SRC
uvedit_buttons.c

View File

@ -556,7 +556,6 @@ set(INC
set(INC_SYS
${PYTHON_INCLUDE_DIRS}
${PNG_INC}
)
add_definitions(-DWITH_FREESTYLE)

View File

@ -43,7 +43,6 @@ set(INC
set(INC_SYS
${Epoxy_INCLUDE_DIRS}
${VULKAN_INCLUDE_DIRS}
)
set(SRC
@ -267,6 +266,10 @@ set(METAL_SRC
metal/mtl_vertex_buffer.hh
)
set(LIB
${Epoxy_LIBRARIES}
)
# Select Backend source based on availability
if(WITH_OPENGL)
list(APPEND SRC ${OPENGL_SRC})
@ -276,27 +279,23 @@ if(WITH_METAL_BACKEND)
list(APPEND SRC ${METAL_SRC})
endif()
set(LIB
${Epoxy_LIBRARIES}
${VULKAN_LIBRARIES}
)
if(WITH_VULKAN_BACKEND)
list(APPEND SRC ${VULKAN_SRC})
add_definitions(-DWITH_VULKAN_BACKEND)
list(APPEND INC_SYS
${VULKAN_INCLUDE_DIRS}
)
list(APPEND INC
../../../extern/vulkan_memory_allocator/
)
list(APPEND INC_SYS
${VULKAN_INCLUDE_DIRS}
)
list(APPEND SRC
${VULKAN_SRC}
)
list(APPEND LIB
${VULKAN_LIBRARIES}
extern_vulkan_memory_allocator
)
add_definitions(-DWITH_VULKAN_BACKEND)
endif()
set(MSL_SRC

View File

@ -28,8 +28,13 @@ set(LIB
if(WITH_OPENIMAGEIO)
list(APPEND INC_SYS
${OPENIMAGEIO_INCLUDE_DIRS}
${BOOST_INCLUDE_DIR}
)
if(WITH_BOOST)
list(APPEND INC_SYS
${BOOST_INCLUDE_DIR}
)
endif()
list(APPEND LIB
${OPENIMAGEIO_LIBRARIES}
${PUGIXML_LIBRARIES}
@ -43,10 +48,11 @@ if(WITH_OPENIMAGEIO)
)
endif()
list(APPEND LIB
${BOOST_LIBRARIES}
)
if(WITH_BOOST)
list(APPEND LIB
${BOOST_LIBRARIES}
)
endif()
add_definitions(-DWITH_OPENIMAGEIO)
endif()

View File

@ -20,10 +20,15 @@ set(INC
set(INC_SYS
${ALEMBIC_INCLUDE_DIRS}
${BOOST_INCLUDE_DIR}
${OPENEXR_INCLUDE_DIRS}
)
if(WITH_BOOST)
list(APPEND INC_SYS
${BOOST_INCLUDE_DIR}
)
endif()
set(SRC
intern/abc_axis_conversion.cc
intern/abc_customdata.cc
@ -92,9 +97,11 @@ set(LIB
${OPENEXR_LIBRARIES}
)
list(APPEND LIB
${BOOST_LIBRARIES}
)
if(WITH_BOOST)
list(APPEND LIB
${BOOST_LIBRARIES}
)
endif()
blender_add_lib(bf_alembic "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")

View File

@ -74,9 +74,10 @@ if(WITH_HARU)
add_definitions(-DWITH_HARU)
endif()
list(APPEND LIB
${BOOST_LIBRARIES}
)
if(WITH_BOOST)
list(APPEND LIB
${BOOST_LIBRARIES}
)
endif()
blender_add_lib(bf_gpencil "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")

View File

@ -70,7 +70,9 @@ blender_target_include_dirs(makesdna ${INC})
blender_target_include_dirs_sys(makesdna ${INC_SYS})
if(WIN32 AND NOT UNIX)
target_link_libraries(makesdna ${PTHREADS_LIBRARIES})
if(DEFINED PTHREADS_LIBRARIES)
target_link_libraries(makesdna ${PTHREADS_LIBRARIES})
endif()
endif()
# Output dna.c

View File

@ -271,15 +271,16 @@ if(WITH_IMAGE_WEBP)
endif()
if(WITH_AUDASPACE)
add_definitions(-DWITH_AUDASPACE)
list(APPEND INC_SYS
${AUDASPACE_C_INCLUDE_DIRS}
)
list(APPEND LIB
${AUDASPACE_C_LIBRARIES}
${AUDASPACE_PY_LIBRARIES}
)
if(WITH_SYSTEM_AUDASPACE)
list(APPEND LIB
${AUDASPACE_C_LIBRARIES}
${AUDASPACE_PY_LIBRARIES}
)
endif()
add_definitions(-DWITH_AUDASPACE)
endif()
if(WITH_CODEC_FFMPEG)
@ -405,7 +406,9 @@ target_link_libraries(makesrna bf_dna)
target_link_libraries(makesrna bf_dna_blenlib)
if(WIN32 AND NOT UNIX)
target_link_libraries(makesrna ${PTHREADS_LIBRARIES})
if(DEFINED PTHREADS_LIBRARIES)
target_link_libraries(makesrna ${PTHREADS_LIBRARIES})
endif()
endif()
# Output `rna_*_gen.c`.

View File

@ -28,6 +28,8 @@ set(INC
${CMAKE_BINARY_DIR}/source/blender/makesrna
)
set(INC_SYS
)
set(SRC
nodes/node_composite_alpha_over.cc

View File

@ -16,6 +16,8 @@ set(INC
../../../../intern/guardedalloc
)
set(INC_SYS
)
set(SRC
nodes/node_fn_align_euler_to_vector.cc

View File

@ -20,6 +20,8 @@ set(INC
${CMAKE_BINARY_DIR}/source/blender/makesrna
)
set(INC_SYS
)
set(SRC
nodes/node_texture_at.cc

View File

@ -24,6 +24,8 @@ set(INC
../../../intern/mantaflow/extern
)
set(INC_SYS
)
set(SRC
intern/bake.cc

View File

@ -90,15 +90,16 @@ set(LIB
)
if(WITH_AUDASPACE)
add_definitions(-DWITH_AUDASPACE)
list(APPEND INC_SYS
${AUDASPACE_C_INCLUDE_DIRS}
)
list(APPEND LIB
${AUDASPACE_C_LIBRARIES}
${AUDASPACE_PY_LIBRARIES}
)
if(WITH_SYSTEM_AUDASPACE)
list(APPEND LIB
${AUDASPACE_C_LIBRARIES}
${AUDASPACE_PY_LIBRARIES}
)
endif()
add_definitions(-DWITH_AUDASPACE)
endif()
blender_add_lib(bf_sequencer "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")

View File

@ -106,15 +106,16 @@ set(LIB
)
if(WITH_AUDASPACE)
add_definitions(-DWITH_AUDASPACE)
list(APPEND INC_SYS
${AUDASPACE_C_INCLUDE_DIRS}
)
list(APPEND LIB
${AUDASPACE_C_LIBRARIES}
${AUDASPACE_PY_LIBRARIES}
)
if(WITH_SYSTEM_AUDASPACE)
list(APPEND LIB
${AUDASPACE_C_LIBRARIES}
${AUDASPACE_PY_LIBRARIES}
)
endif()
add_definitions(-DWITH_AUDASPACE)
endif()
if(WITH_CYCLES)

View File

@ -32,7 +32,7 @@ endif()
# Include these arguments before all others, they must not interfere with Python execution.
set(TEST_PYTHON_EXE_EXTRA_ARGS)
set(TEST_PYTHON_EXE_EXTRA_ARGS "")
# Check if this a Blender managed Python installation, if so, don't add `*.pyc` files.
if(LIBDIR)

View File

@ -26,11 +26,14 @@ function(add_blender_test testname)
COMMAND "${TEST_BLENDER_EXE}" ${TEST_BLENDER_EXE_PARAMS} ${ARGN}
)
# Don't fail tests on leaks since these often happen in external libraries
# that we can't fix.
set_tests_properties(${testname} PROPERTIES ENVIRONMENT
LSAN_OPTIONS=exitcode=0:$ENV{LSAN_OPTIONS}
)
# Don't fail tests on leaks since these often happen in external libraries that we can't fix.
set(_lsan_options "exitcode=0")
if(DEFINED ENV{LSAN_OPTIONS})
set(_lsan_options "${_lsan_options}:$ENV{LSAN_OPTIONS}")
endif()
set_tests_properties(${testname} PROPERTIES ENVIRONMENT "LSAN_OPTIONS=${_lsan_options}")
unset(_lsan_options)
if(PLATFORM_ENV_INSTALL)
set_tests_properties(${testname} PROPERTIES ENVIRONMENT "${PLATFORM_ENV_INSTALL}")
endif()
@ -47,9 +50,14 @@ function(add_python_test testname testscript)
COMMAND ${TEST_PYTHON_EXE} ${TEST_PYTHON_EXE_EXTRA_ARGS} ${testscript} ${ARGN}
WORKING_DIRECTORY $<TARGET_FILE_DIR:blender>
)
set_tests_properties(${testname} PROPERTIES ENVIRONMENT
LSAN_OPTIONS=exitcode=0:$ENV{LSAN_OPTIONS}
)
set(_lsan_options "exitcode=0")
if(DEFINED ENV{LSAN_OPTIONS})
set(_lsan_options "${_lsan_options}:$ENV{LSAN_OPTIONS}")
endif()
set_tests_properties(${testname} PROPERTIES ENVIRONMENT "LSAN_OPTIONS=${_lsan_options}")
unset(_lsan_options)
if(PLATFORM_ENV_INSTALL)
set_tests_properties(${testname} PROPERTIES ENVIRONMENT "${PLATFORM_ENV_INSTALL}")
endif()
@ -639,20 +647,24 @@ endif()
# SVG Import
if(True)
set(_svg_render_tests complex path)
if(NOT OPENIMAGEIO_IDIFF)
message(WARNING "Disabling SVG tests because OIIO idiff does not exist")
else()
set(_svg_render_tests complex path)
foreach(render_test ${_svg_render_tests})
add_python_test(
io_curve_svg_${render_test}
${CMAKE_CURRENT_LIST_DIR}/bl_io_curve_svg_test.py
-blender "${TEST_BLENDER_EXE}"
-testdir "${TEST_SRC_DIR}/io_tests/svg/${render_test}"
-idiff "${OPENIMAGEIO_IDIFF}"
-outdir "${TEST_OUT_DIR}/io_curve_svg"
)
endforeach()
foreach(render_test ${_svg_render_tests})
add_python_test(
io_curve_svg_${render_test}
${CMAKE_CURRENT_LIST_DIR}/bl_io_curve_svg_test.py
-blender "${TEST_BLENDER_EXE}"
-testdir "${TEST_SRC_DIR}/io_tests/svg/${render_test}"
-idiff "${OPENIMAGEIO_IDIFF}"
-outdir "${TEST_OUT_DIR}/io_curve_svg"
)
endforeach()
unset(_svg_render_tests)
unset(_svg_render_tests)
endif()
endif()
if(WITH_CYCLES OR WITH_OPENGL_RENDER_TESTS)
@ -715,6 +727,7 @@ if(WITH_CYCLES OR WITH_OPENGL_RENDER_TESTS)
# Cycles
if(WITH_CYCLES)
set(_cycles_blacklist "")
if(NOT WITH_CYCLES_OSL)
set(_cycles_blacklist OSL)
endif()
@ -735,6 +748,7 @@ if(WITH_CYCLES OR WITH_OPENGL_RENDER_TESTS)
)
endforeach()
endforeach()
unset(_cycles_blacklist)
endif()
if(WITH_OPENGL_RENDER_TESTS)
@ -766,32 +780,35 @@ if(WITH_CYCLES OR WITH_OPENGL_RENDER_TESTS)
endif()
if(WITH_COMPOSITOR_CPU)
set(compositor_tests
color
converter
filter
input
output
vector
if(NOT OPENIMAGEIO_IDIFF)
message(WARNING "Disabling Compositor CPU tests because OIIO idiff does not exist")
else()
set(compositor_tests
color
converter
filter
input
output
vector
multiple_node_setups
)
if(WITH_LIBMV)
list(APPEND compositor_tests distort matte)
endif()
foreach(comp_test ${compositor_tests})
add_python_test(
compositor_${comp_test}_test
${CMAKE_CURRENT_LIST_DIR}/compositor_render_tests.py
-blender "${TEST_BLENDER_EXE}"
-testdir "${TEST_SRC_DIR}/compositor/${comp_test}"
-idiff "${OPENIMAGEIO_IDIFF}"
-outdir "${TEST_OUT_DIR}/compositor"
multiple_node_setups
)
endforeach()
if(WITH_LIBMV)
list(APPEND compositor_tests distort matte)
endif()
foreach(comp_test ${compositor_tests})
add_python_test(
compositor_${comp_test}_test
${CMAKE_CURRENT_LIST_DIR}/compositor_render_tests.py
-blender "${TEST_BLENDER_EXE}"
-testdir "${TEST_SRC_DIR}/compositor/${comp_test}"
-idiff "${OPENIMAGEIO_IDIFF}"
-outdir "${TEST_OUT_DIR}/compositor"
)
endforeach()
endif()
endif()
set(geo_node_tests