Cleanup: line length in CMake files

This commit is contained in:
Campbell Barton 2024-03-07 13:26:55 +11:00
parent 6618755912
commit a975c7096a
13 changed files with 177 additions and 59 deletions

@ -797,9 +797,19 @@ endif()
# Unit testing
option(WITH_GTESTS "Enable GTest unit testing" OFF)
option(WITH_GPU_RENDER_TESTS "Enable GPU render related unit testing (EEVEE, Workbench and Grease Pencil)" OFF)
option(WITH_GPU_RENDER_TESTS_SILENT "Run GPU render tests silently (finished tests will pass). Generated report will show failing tests" ON)
option(WITH_GPU_DRAW_TESTS "Enable GPU drawing related unit testing (GPU backends and draw manager)" OFF)
option(WITH_GPU_RENDER_TESTS "\
Enable GPU render related unit testing (EEVEE, Workbench and Grease Pencil)"
OFF
)
option(WITH_GPU_RENDER_TESTS_SILENT "\
Run GPU render tests silently (finished tests will pass). \
Generated report will show failing tests"
ON
)
option(WITH_GPU_DRAW_TESTS "\
Enable GPU drawing related unit testing (GPU backends and draw manager)"
OFF
)
option(WITH_COMPOSITOR_REALTIME_TESTS "Enable regression testing for realtime compositor" OFF)
if(UNIX AND NOT (APPLE OR HAIKU))
option(WITH_UI_TESTS "\
@ -816,7 +826,10 @@ endif()
# Enabled by default for typical use cases to speed up development cycles. However, when looking
# into threading or memory related issues (in dependency graph, out-of-bounds, etc) forcing single
# test per Blender instance could give much better clues about the root of the problem.
option(WITH_TESTS_BATCHED "Run multiple tests in a single Blender invocation, for faster test execution" ON)
option(WITH_TESTS_BATCHED "\
Run multiple tests in a single Blender invocation, for faster test execution"
ON
)
mark_as_advanced(WITH_TESTS_BATCHED)
option(WITH_TESTS_SINGLE_BINARY "\
@ -1354,7 +1367,7 @@ if(NOT CMAKE_BUILD_TYPE MATCHES "Release")
# affect on the printed backtrace, and exception handling was correct as well.
#
# Related discussion:
# https://stackoverflow.com/questions/26300819/why-gcc-compiled-c-program-needs-eh-frame-section
# https://stackoverflow.com/questions/26300819
add_compile_options("$<${_is_CONFIG_DEBUG}:-fno-unwind-tables>")
add_compile_options("$<${_is_CONFIG_DEBUG}:-fno-asynchronous-unwind-tables>")
@ -1675,12 +1688,14 @@ if("${CMAKE_GENERATOR}" MATCHES "Ninja" AND WITH_NINJA_POOL_JOBS)
# but this also accounts for the part of the physical RAM being used by other unrelated
# processes on the system, and the part being used by the 'regular' compile and linking jobs.
#
# Also always cap heavy jobs amount to `number of available threads - 1`, to ensure that even if
# there would be enough RAM, the machine never ends up handling only heavy jobs at some point.
# This can have annoying sides effects, like lack of output in the console for several minutes,
# which can lead to a wrong detection of 'unresponsive' state by the buildbots e.g.
# Also always cap heavy jobs amount to `number of available threads - 1`,
# to ensure that even if there would be enough RAM, the machine never ends up
# handling only heavy jobs at some point.
# This can have annoying sides effects, like lack of output in the console for several
# minutes, which can lead to a wrong detection of 'unresponsive' state by the build-bots e.g.
#
# Currently, these settings applied to a 64GB/16threads linux machine will use, for a full build:
# Currently, these settings applied to a 64GB/16threads linux machine will use,
# for a full build:
# - release build:
# * RAM: typically less than 20%, with some peaks at 25%.
# * CPU: over 90% of usage on average over the whole build time.

@ -116,7 +116,8 @@ if(NOT BLENDER_PLATFORM_WINDOWS_ARM)
endif()
# Embree needs to be included after dpcpp as it uses it for compiling with GPU support
if(BLENDER_PLATFORM_WINDOWS_ARM)
# WoA needs embree to be built with the VS Generator + LLVM, put it in it's own file to avoid clutter
# WoA needs embree to be built with the VS Generator + LLVM,
# put it in it's own file to avoid clutter.
include(cmake/embree_windows_arm.cmake)
else()
include(cmake/embree.cmake)

@ -15,7 +15,8 @@ foreach(_variableName ${_variableNames})
# First see if DEP_HOMEPAGE is set, if it is use that.
set(DEP_HOMEPAGE ${${DEP_NAME}_HOMEPAGE})
if(NOT DEP_HOMEPAGE)
# If the xxx_HOMEPAGE is not set but the URI for the archive is a known github format extract the reprository/project from the URI
# If the xxx_HOMEPAGE is not set but the URI for the archive is a known github format
# extract the repository/project from the URI.
string(REGEX MATCH "https:\/\/(.*)github\.com\/(.+)\/(archive|releases|release|tar.gz)\/(.*)" DEP_PROJECT "${${_variableName}}")
if(CMAKE_MATCH_2)
set(DEP_HOMEPAGE "https://www.github.com/${CMAKE_MATCH_2}")

@ -43,15 +43,18 @@ set(EMBREE_EXTRA_ARGS
# We want the VS2019 tools for embree, as they are stable.
# We cannot use VS2022 easily, unless we specify an older (unsupported) toolset such as 17.35,
# as the newer toolsets mandate LLVM 16, which we cannot use currently, due to lack of support in OSL and ISPC.
# as the newer toolsets mandate LLVM 16, which we cannot use currently,
# due to lack of support in OSL and ISPC.
set(EMBREE_VCTOOLS_REQUIRED_VERSION 14.29)
# Extract the list of installed tools that match the required version from the `VCToolsInstallDir` env var
# Extract the list of installed tools that match the required version from the
# `VCToolsInstallDir` env var
file(TO_CMAKE_PATH $ENV{VCToolsInstallDir} EMBREE_VCTOOLSINSTALLDIR_PATH)
cmake_path(GET EMBREE_VCTOOLSINSTALLDIR_PATH PARENT_PATH EMBREE_VCTOOLSDIR_PATH)
file(GLOB EMBREE_INSTALLED_VCTOOLS RELATIVE ${EMBREE_VCTOOLSDIR_PATH} ${EMBREE_VCTOOLSDIR_PATH}/${EMBREE_VCTOOLS_REQUIRED_VERSION}*)
# Check that at least one the installed tool versions (there may be different subversions) is present
# Check that at least one the installed tool versions
# (there may be different subversions) is present.
if(NOT EMBREE_INSTALLED_VCTOOLS)
message(FATAL_ERROR "When building for Windows ARM64 platforms, embree requires VC Tools ${EMBREE_VCTOOLS_REQUIRED_VERSION} to be installed alongside the current version.")
endif()
@ -60,15 +63,26 @@ endif()
list(SORT EMBREE_INSTALLED_VCTOOLS)
list(GET EMBREE_INSTALLED_VCTOOLS -1 EMBREE_VCTOOLS_VERSION)
# Configure our in file and temporarily store it in the build dir (with modified extension so nothing else picks it up)
# This feels icky, but boost does something similar, and we haven't called ExternalProject_Add yet, so the embree dir does not yet exist
configure_file(${PATCH_DIR}/embree_Directory.Build.Props.in ${BUILD_DIR}/embree_Directory.Build.Props_temp)
# Configure our in file and temporarily store it in the build dir
# (with modified extension so nothing else picks it up)
# This feels icky, but boost does something similar, and we haven't called
# `ExternalProject_Add` yet, so the embree dir does not yet exist.
configure_file(
${PATCH_DIR}/embree_Directory.Build.Props.in
${BUILD_DIR}/embree_Directory.Build.Props_temp
)
# Update the patch command to copy the configured build props file in
set(EMBREE_PATCH_COMMAND COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/embree_Directory.Build.Props_temp ${BUILD_DIR}/embree/src/external_embree-build/Directory.Build.Props && ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/embree/src/external_embree < ${PATCH_DIR}/embree.diff)
set(EMBREE_PATCH_COMMAND
COMMAND ${CMAKE_COMMAND} -E copy
${BUILD_DIR}/embree_Directory.Build.Props_temp
${BUILD_DIR}/embree/src/external_embree-build/Directory.Build.Props &&
${PATCH_CMD} -p 1 -d ${BUILD_DIR}/embree/src/external_embree < ${PATCH_DIR}/embree.diff
)
# This all only works if we use the VS generator (with clangcl toolset), so switch back to that
# Note: there is literally no way to get ninja to use a different toolset other than manually overwriting every env var, or calling a nested vcvarsall, both of which are *messy*
# This all only works if we use the VS generator (with `clangcl` toolset), so switch back to that
# Note: there is literally no way to get ninja to use a different toolset other than manually
# overwriting every env var, or calling a nested `vcvarsall`, both of which are *messy*.
set(EMBREE_GENERATOR ${CMAKE_GENERATOR})
set(EMBREE_GENERATOR_TOOLSET ClangCL)
@ -99,16 +113,30 @@ add_dependencies(
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_embree after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/embree/include ${HARVEST_TARGET}/embree/include
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/embree/lib ${HARVEST_TARGET}/embree/lib
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/embree/share ${HARVEST_TARGET}/embree/share
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/bin/embree4.dll ${HARVEST_TARGET}/embree/bin/embree4.dll
COMMAND ${CMAKE_COMMAND} -E copy_directory
${LIBDIR}/embree/include
${HARVEST_TARGET}/embree/include
COMMAND ${CMAKE_COMMAND} -E copy_directory
${LIBDIR}/embree/lib
${HARVEST_TARGET}/embree/lib
COMMAND ${CMAKE_COMMAND} -E copy_directory
${LIBDIR}/embree/share
${HARVEST_TARGET}/embree/share
COMMAND ${CMAKE_COMMAND} -E copy
${LIBDIR}/embree/bin/embree4.dll
${HARVEST_TARGET}/embree/bin/embree4.dll
DEPENDEES install
)
else()
ExternalProject_Add_Step(external_embree after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/bin/embree4_d.dll ${HARVEST_TARGET}/embree/bin/embree4_d.dll
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/embree4_d.lib ${HARVEST_TARGET}/embree/lib/embree4_d.lib
COMMAND ${CMAKE_COMMAND} -E copy
${LIBDIR}/embree/bin/embree4_d.dll
${HARVEST_TARGET}/embree/bin/embree4_d.dll
COMMAND ${CMAKE_COMMAND} -E copy
${LIBDIR}/embree/lib/embree4_d.lib
${HARVEST_TARGET}/embree/lib/embree4_d.lib
DEPENDEES install
)
endif()

@ -116,12 +116,14 @@ else()
endif()
set(PYTHON_BINARY ${LIBDIR}/python/bin/python${PYTHON_SHORT_VERSION})
# Various flags to convince Python to use our own versions of ffi, sqlite, ssl, bzip2, lzma and zlib.
# Various flags to convince Python to use our own versions of:
# `ffi`, `sqlite`, `ssl`, `bzip2`, `lzma` and `zlib`.
# Using pkg-config is only supported for some, and even then we need to work around issues.
set(PYTHON_CONFIGURE_EXTRA_ARGS --with-openssl=${LIBDIR}/ssl)
set(PYTHON_CFLAGS "${PLATFORM_CFLAGS} ")
# Manually specify some library paths. For ffi there is no other way, for sqlite is needed because
# LIBSQLITE3_LIBS does not work, and ssl because it uses the wrong ssl/lib dir instead of ssl/lib64.
# Manually specify some library paths. For ffi there is no other way,
# for sqlite is needed because LIBSQLITE3_LIBS does not work,
# and ssl because it uses the wrong ssl/lib dir instead of ssl/lib64.
set(PYTHON_LDFLAGS "-L${LIBDIR}/ffi/lib -L${LIBDIR}/sqlite/lib -L${LIBDIR}/ssl/lib -L${LIBDIR}/ssl/lib64 ${PLATFORM_LDFLAGS} ")
set(PYTHON_CONFIGURE_EXTRA_ENV
export CFLAGS=${PYTHON_CFLAGS} &&

@ -87,7 +87,8 @@ if(EXISTS "${DOWNLOAD_DIR}/msys2/msys64/usr/bin/perl.exe")
)
endif()
# Strip out the copy of link that comes with some packages if it exists, otherwise meson builds break
# Strip out the copy of link that comes with some packages if it exists,
# otherwise meson builds break.
if(EXISTS "${DOWNLOAD_DIR}/msys2/msys64/usr/bin/link.exe")
execute_process(
COMMAND ${CMAKE_COMMAND} -E rm ${DOWNLOAD_DIR}/msys2/msys64/usr/bin/link.exe

@ -5,7 +5,8 @@
set(SSL_CONFIGURE_COMMAND ./Configure)
if(WIN32)
# Python will build this with its preferred build options and patches. We only need to unpack openssl
# Python will build this with its preferred build options and patches.
# We only need to unpack openssl.
ExternalProject_Add(external_ssl
URL file://${PACKAGE_DIR}/${SSL_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}

@ -41,7 +41,8 @@ if(NOT WIN32)
INSTALL_DIR ${LIBDIR}/theora
)
else()
# We are kind of naughty here and steal vorbis' FindOgg.cmake, but given it's a dependency anyway...
# We are kind of naughty here and steal vorbis' `FindOgg.cmake`,
# but given it's a dependency anyway.
ExternalProject_Add(external_theora
URL file://${PACKAGE_DIR}/${THEORA_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}

@ -1136,8 +1136,12 @@ if(PLATFORM_BUNDLED_LIBRARIES)
# Environment variables to run precompiled executables that needed libraries.
list(JOIN PLATFORM_BUNDLED_LIBRARY_DIRS ":" _library_paths)
set(PLATFORM_ENV_BUILD "LD_LIBRARY_PATH=\"${_library_paths}:$LD_LIBRARY_PATH\"")
set(PLATFORM_ENV_INSTALL "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX_WITH_CONFIG}/lib/;$LD_LIBRARY_PATH")
set(PLATFORM_ENV_BUILD
"LD_LIBRARY_PATH=\"${_library_paths}:$LD_LIBRARY_PATH\""
)
set(PLATFORM_ENV_INSTALL
"LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX_WITH_CONFIG}/lib/;$LD_LIBRARY_PATH"
)
unset(_library_paths)
else()
# Quiet unused variable warnings, unfortunately this can't be empty.

@ -119,7 +119,11 @@ remove_cc_flag("/GR")
add_definitions(-D_WIN32_WINNT=0x603)
# First generate the manifest for tests since it will not need the dependency on the CRT.
configure_file(${CMAKE_SOURCE_DIR}/release/windows/manifest/blender.exe.manifest.in ${CMAKE_CURRENT_BINARY_DIR}/tests.exe.manifest @ONLY)
configure_file(
${CMAKE_SOURCE_DIR}/release/windows/manifest/blender.exe.manifest.in
${CMAKE_CURRENT_BINARY_DIR}/tests.exe.manifest
@ONLY
)
# Always detect CRT paths, but only manually install with WITH_WINDOWS_BUNDLE_CRT.
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
@ -152,7 +156,11 @@ endif()
if(NOT WITH_PYTHON_MODULE)
set(BUNDLECRT "${BUNDLECRT}<dependency><dependentAssembly><assemblyIdentity type=\"win32\" name=\"blender.shared\" version=\"1.0.0.0\" /></dependentAssembly></dependency>")
endif()
configure_file(${CMAKE_SOURCE_DIR}/release/windows/manifest/blender.exe.manifest.in ${CMAKE_CURRENT_BINARY_DIR}/blender.exe.manifest @ONLY)
configure_file(
${CMAKE_SOURCE_DIR}/release/windows/manifest/blender.exe.manifest.in
${CMAKE_CURRENT_BINARY_DIR}/blender.exe.manifest
@ONLY
)
remove_cc_flag(
"/MDd"
@ -328,7 +336,10 @@ foreach(child ${children})
endforeach()
if(WITH_PUGIXML)
set(PUGIXML_LIBRARIES optimized ${LIBDIR}/pugixml/lib/pugixml.lib debug ${LIBDIR}/pugixml/lib/pugixml_d.lib)
set(PUGIXML_LIBRARIES
optimized ${LIBDIR}/pugixml/lib/pugixml.lib
debug ${LIBDIR}/pugixml/lib/pugixml_d.lib
)
set(PUGIXML_INCLUDE_DIR ${LIBDIR}/pugixml/include)
endif()
@ -386,7 +397,10 @@ if(WITH_HARFBUZZ)
windows_find_package(Harfbuzz)
if(NOT Harfbuzz_FOUND)
set(LIBHARFBUZZ_INCLUDE_DIRS ${LIBDIR}/harfbuzz/include)
set(LIBHARFBUZZ_LIBRARIES optimized ${LIBDIR}/harfbuzz/lib/libharfbuzz.lib debug ${LIBDIR}/harfbuzz/lib/libharfbuzz_d.lib)
set(LIBHARFBUZZ_LIBRARIES
optimized ${LIBDIR}/harfbuzz/lib/libharfbuzz.lib
debug ${LIBDIR}/harfbuzz/lib/libharfbuzz_d.lib
)
set(Harfbuzz_FOUND ON)
endif()
endif()
@ -522,7 +536,11 @@ if(WITH_IMAGE_OPENEXR)
warn_hardcoded_paths(OpenEXR)
set(OPENEXR ${LIBDIR}/openexr)
set(OPENEXR_INCLUDE_DIR ${OPENEXR}/include)
set(OPENEXR_INCLUDE_DIRS ${OPENEXR_INCLUDE_DIR} ${IMATH_INCLUDE_DIRS} ${OPENEXR_INCLUDE_DIR}/OpenEXR)
set(OPENEXR_INCLUDE_DIRS
${OPENEXR_INCLUDE_DIR}
${IMATH_INCLUDE_DIRS}
${OPENEXR_INCLUDE_DIR}/OpenEXR
)
set(OPENEXR_LIBPATH ${OPENEXR}/lib)
# Check if the blender 3.3 lib static library eixts
# if not assume this is a 3.4+ dynamic version.
@ -558,7 +576,10 @@ if(WITH_JACK)
${LIBDIR}/jack/include/jack
${LIBDIR}/jack/include
)
set(JACK_LIBRARIES optimized ${LIBDIR}/jack/lib/libjack.lib debug ${LIBDIR}/jack/lib/libjack_d.lib)
set(JACK_LIBRARIES
optimized ${LIBDIR}/jack/lib/libjack.lib
debug ${LIBDIR}/jack/lib/libjack_d.lib
)
endif()
set(_PYTHON_VERSION "3.11")
@ -592,7 +613,10 @@ if(WITH_PYTHON)
set(NUMPY_FOUND ON)
# uncached vars
set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
set(PYTHON_LIBRARIES debug "${PYTHON_LIBRARY_DEBUG}" optimized "${PYTHON_LIBRARY}" )
set(PYTHON_LIBRARIES
debug "${PYTHON_LIBRARY_DEBUG}"
optimized "${PYTHON_LIBRARY}"
)
endif()
if(NOT WITH_WINDOWS_FIND_MODULES)
@ -696,8 +720,14 @@ if(NOT OpenImageIO_FOUND)
set(OPENIMAGEIO_LIBPATH ${OPENIMAGEIO}/lib)
set(OPENIMAGEIO_INCLUDE_DIR ${OPENIMAGEIO}/include)
set(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO_INCLUDE_DIR})
set(OIIO_OPTIMIZED optimized ${OPENIMAGEIO_LIBPATH}/OpenImageIO.lib optimized ${OPENIMAGEIO_LIBPATH}/OpenImageIO_Util.lib)
set(OIIO_DEBUG debug ${OPENIMAGEIO_LIBPATH}/OpenImageIO_d.lib debug ${OPENIMAGEIO_LIBPATH}/OpenImageIO_Util_d.lib)
set(OIIO_OPTIMIZED
optimized ${OPENIMAGEIO_LIBPATH}/OpenImageIO.lib
optimized ${OPENIMAGEIO_LIBPATH}/OpenImageIO_Util.lib
)
set(OIIO_DEBUG
debug ${OPENIMAGEIO_LIBPATH}/OpenImageIO_d.lib
debug ${OPENIMAGEIO_LIBPATH}/OpenImageIO_Util_d.lib
)
set(OPENIMAGEIO_LIBRARIES ${OIIO_OPTIMIZED} ${OIIO_DEBUG})
set(OPENIMAGEIO_TOOL "${OPENIMAGEIO}/bin/oiiotool.exe")
endif()
@ -761,7 +791,10 @@ if(WITH_OPENVDB)
set(OPENVDB ${LIBDIR}/openVDB)
set(OPENVDB_LIBPATH ${OPENVDB}/lib)
set(OPENVDB_INCLUDE_DIRS ${OPENVDB}/include)
set(OPENVDB_LIBRARIES optimized ${OPENVDB_LIBPATH}/openvdb.lib debug ${OPENVDB_LIBPATH}/openvdb_d.lib )
set(OPENVDB_LIBRARIES
optimized ${OPENVDB_LIBPATH}/openvdb.lib
debug ${OPENVDB_LIBPATH}/openvdb_d.lib
)
endif()
set(OPENVDB_DEFINITIONS -DNOMINMAX -D_USE_MATH_DEFINES)
endif()
@ -785,7 +818,10 @@ if(WITH_OPENIMAGEDENOISE)
get_target_property(OPENIMAGEDENOISE_LIBRARIES_RELEASE OpenImageDenoise IMPORTED_IMPLIB_RELEASE)
get_target_property(OPENIMAGEDENOISE_LIBRARIES_DEBUG OpenImageDenoise IMPORTED_IMPLIB_DEBUG)
if(EXISTS ${OPENIMAGEDENOISE_LIBRARIES_DEBUG})
set(OPENIMAGEDENOISE_LIBRARIES optimized ${OPENIMAGEDENOISE_LIBRARIES_RELEASE} debug ${OPENIMAGEDENOISE_LIBRARIES_DEBUG})
set(OPENIMAGEDENOISE_LIBRARIES
optimized ${OPENIMAGEDENOISE_LIBRARIES_RELEASE}
debug ${OPENIMAGEDENOISE_LIBRARIES_DEBUG}
)
else()
if(EXISTS ${OPENIMAGEDENOISE_LIBRARIES_RELEASE})
set(OPENIMAGEDENOISE_LIBRARIES ${OPENIMAGEDENOISE_LIBRARIES_RELEASE})
@ -820,7 +856,10 @@ if(WITH_ALEMBIC)
set(ALEMBIC_INCLUDE_DIR ${ALEMBIC}/include)
set(ALEMBIC_INCLUDE_DIRS ${ALEMBIC_INCLUDE_DIR})
set(ALEMBIC_LIBPATH ${ALEMBIC}/lib)
set(ALEMBIC_LIBRARIES optimized ${ALEMBIC}/lib/Alembic.lib debug ${ALEMBIC}/lib/Alembic_d.lib)
set(ALEMBIC_LIBRARIES
optimized ${ALEMBIC}/lib/Alembic.lib
debug ${ALEMBIC}/lib/Alembic_d.lib
)
set(ALEMBIC_FOUND 1)
endif()
@ -870,11 +909,17 @@ endif()
if(WITH_TBB)
windows_find_package(TBB)
if(NOT TBB_FOUND)
set(TBB_LIBRARIES optimized ${LIBDIR}/tbb/lib/tbb.lib debug ${LIBDIR}/tbb/lib/tbb_debug.lib)
set(TBB_LIBRARIES
optimized ${LIBDIR}/tbb/lib/tbb.lib
debug ${LIBDIR}/tbb/lib/tbb_debug.lib
)
set(TBB_INCLUDE_DIR ${LIBDIR}/tbb/include)
set(TBB_INCLUDE_DIRS ${TBB_INCLUDE_DIR})
if(WITH_TBB_MALLOC_PROXY)
set(TBB_MALLOC_LIBRARIES optimized ${LIBDIR}/tbb/lib/tbbmalloc.lib debug ${LIBDIR}/tbb/lib/tbbmalloc_debug.lib)
set(TBB_MALLOC_LIBRARIES
optimized ${LIBDIR}/tbb/lib/tbbmalloc.lib
debug ${LIBDIR}/tbb/lib/tbbmalloc_debug.lib
)
add_definitions(-DWITH_TBB_MALLOC)
endif()
endif()
@ -1126,9 +1171,15 @@ if(WITH_XR_OPENXR)
# support the transition between the old and new lib versions
# this can be removed after the next lib update.
if(EXISTS ${XR_OPENXR_SDK_LIBPATH}/openxr_loader_d.lib)
set(XR_OPENXR_SDK_LIBRARIES optimized ${XR_OPENXR_SDK_LIBPATH}/openxr_loader.lib debug ${XR_OPENXR_SDK_LIBPATH}/openxr_loader_d.lib)
set(XR_OPENXR_SDK_LIBRARIES
optimized ${XR_OPENXR_SDK_LIBPATH}/openxr_loader.lib
debug ${XR_OPENXR_SDK_LIBPATH}/openxr_loader_d.lib
)
else()
set(XR_OPENXR_SDK_LIBRARIES optimized ${XR_OPENXR_SDK_LIBPATH}/openxr_loader.lib debug ${XR_OPENXR_SDK_LIBPATH}/openxr_loaderd.lib)
set(XR_OPENXR_SDK_LIBRARIES
optimized ${XR_OPENXR_SDK_LIBPATH}/openxr_loader.lib
debug ${XR_OPENXR_SDK_LIBPATH}/openxr_loaderd.lib
)
endif()
endif()
@ -1139,7 +1190,10 @@ if(WITH_GMP)
else()
set(GMP_DLL_LIB_NAME libgmp-10.lib)
endif()
set(GMP_LIBRARIES ${LIBDIR}/gmp/lib/${GMP_DLL_LIB_NAME} optimized ${LIBDIR}/gmp/lib/libgmpxx.lib debug ${LIBDIR}/gmp/lib/libgmpxx_d.lib)
set(GMP_LIBRARIES ${LIBDIR}/gmp/lib/${GMP_DLL_LIB_NAME}
optimized ${LIBDIR}/gmp/lib/libgmpxx.lib
debug ${LIBDIR}/gmp/lib/libgmpxx_d.lib
)
set(GMP_ROOT_DIR ${LIBDIR}/gmp)
set(GMP_FOUND ON)
endif()
@ -1193,7 +1247,10 @@ if(WITH_CYCLES AND WITH_CYCLES_PATH_GUIDING)
if(openpgl_FOUND)
get_target_property(OPENPGL_LIBRARIES_RELEASE openpgl::openpgl LOCATION_RELEASE)
get_target_property(OPENPGL_LIBRARIES_DEBUG openpgl::openpgl LOCATION_DEBUG)
set(OPENPGL_LIBRARIES optimized ${OPENPGL_LIBRARIES_RELEASE} debug ${OPENPGL_LIBRARIES_DEBUG})
set(OPENPGL_LIBRARIES
optimized ${OPENPGL_LIBRARIES_RELEASE}
debug ${OPENPGL_LIBRARIES_DEBUG}
)
get_target_property(OPENPGL_INCLUDE_DIR openpgl::openpgl INTERFACE_INCLUDE_DIRECTORIES)
else()
set(WITH_CYCLES_PATH_GUIDING OFF)
@ -1232,7 +1289,10 @@ if(WITH_CYCLES AND (WITH_CYCLES_DEVICE_ONEAPI OR (WITH_CYCLES_EMBREE AND EMBREE_
list(APPEND PLATFORM_BUNDLED_LIBRARIES ${_sycl_runtime_libraries})
unset(_sycl_runtime_libraries)
set(SYCL_LIBRARIES optimized ${SYCL_LIBRARY} debug ${SYCL_LIBRARY_DEBUG})
set(SYCL_LIBRARIES
optimized ${SYCL_LIBRARY}
debug ${SYCL_LIBRARY_DEBUG}
)
endif()
@ -1240,6 +1300,7 @@ endif()
list(JOIN PLATFORM_BUNDLED_LIBRARY_DIRS ";" _library_paths)
set(PLATFORM_ENV_BUILD_DIRS "${LIBDIR}/epoxy/bin\;${LIBDIR}/tbb/bin\;${LIBDIR}/OpenImageIO/bin\;${LIBDIR}/boost/lib\;${LIBDIR}/openexr/bin\;${LIBDIR}/imath/bin\;${LIBDIR}/shaderc/bin\;${PATH}")
set(PLATFORM_ENV_BUILD "PATH=${PLATFORM_ENV_BUILD_DIRS}")
# Install needs the additional folders from PLATFORM_ENV_BUILD_DIRS as well, as tools like idiff and abcls use the release mode dlls
# Install needs the additional folders from PLATFORM_ENV_BUILD_DIRS as well, as tools like:
# `idiff` and `abcls` use the release mode dlls.
set(PLATFORM_ENV_INSTALL "PATH=${CMAKE_INSTALL_PREFIX_WITH_CONFIG}/blender.shared/\;${PLATFORM_ENV_BUILD_DIRS}\;$ENV{PATH}")
unset(_library_paths)

@ -27,8 +27,8 @@ function(blender_test_set_envvars testname envvars_list)
if(NOT CMAKE_BUILD_TYPE MATCHES "Release")
if(WITH_COMPILER_ASAN)
set(_lsan_options "LSAN_OPTIONS=print_suppressions=false:suppressions=${CMAKE_SOURCE_DIR}/tools/config/analysis/lsan.supp")
# FIXME That `allocator_may_return_null=true` ASAN option is only needed for the `guardedalloc` test,
# would be nice to allow tests definition to pass extra envvars better.
# FIXME: That `allocator_may_return_null=true` ASAN option is only needed for the
# `guardedalloc` test, would be nice to allow tests definition to pass extra envvars better.
set(_asan_options "ASAN_OPTIONS=allocator_may_return_null=true")
if(DEFINED ENV{LSAN_OPTIONS})
set(_lsan_options "${_lsan_options}:$ENV{LSAN_OPTIONS}")

@ -95,7 +95,8 @@ elseif(WIN32 AND MSVC AND NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# grained control and the speedup we get here is too big to ignore.
set(CYCLES_KERNEL_FLAGS "/fp:fast -D_CRT_SECURE_NO_WARNINGS /GS-")
# "jumptablerdata" improves performance when there is contention in large switch statements such as in svm.h
# "jumptablerdata" improves performance when there is contention in large switch statements
# such as in `svm.h`.
# This flag is supported starting with MSVC 17.7 preview 3:
# https://learn.microsoft.com/en-us/cpp/build/reference/jump-table-rdata
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.37.32820)

@ -53,7 +53,9 @@ endif()
# Standard Blender arguments for running tests.
# Specify exit code so that if a Python script error happens, the test fails.
set(TEST_BLENDER_EXE_PARAMS --background --factory-startup --debug-memory --debug-exit-on-error --python-exit-code 1)
set(TEST_BLENDER_EXE_PARAMS
--background --factory-startup --debug-memory --debug-exit-on-error --python-exit-code 1
)
# Python CTests
if(WITH_BLENDER AND WITH_PYTHON AND NOT WITH_PYTHON_MODULE)