diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-04-29 18:26:56 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-04-29 18:39:04 +0300 |
commit | 0c317e23bff87e5ea2d908e480ae04eac1b7e2f8 (patch) | |
tree | d5ef1eddce932de167d7f9e8cb5dc5fce2432ce4 /intern/cycles/kernel/CMakeLists.txt | |
parent | 5d84d9b0d6ad114109d60cf3d0ddcd9bb1a5de13 (diff) |
Cleanup: fix various Cycles build warnings with non-default options
* Float/double promotion warnings were mainly meant for avoiding slow
operatiosn in the kernel. Limit it to that to avoid hard to fix warnings
in Hydra.
* Const warnings in Hydra iterators.
* Unused variable warnings when building without glog.
* Wrong camera enum comparisons in assert.
* PASS_UNUSED is not a pass type, only for pass offsets.
Diffstat (limited to 'intern/cycles/kernel/CMakeLists.txt')
-rw-r--r-- | intern/cycles/kernel/CMakeLists.txt | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/intern/cycles/kernel/CMakeLists.txt b/intern/cycles/kernel/CMakeLists.txt index d660289ed17..c6ac280633b 100644 --- a/intern/cycles/kernel/CMakeLists.txt +++ b/intern/cycles/kernel/CMakeLists.txt @@ -733,6 +733,14 @@ if(CXX_HAS_AVX2) set_source_files_properties(device/cpu/kernel_avx2.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_AVX2_KERNEL_FLAGS}") endif() +# Warnings to avoid using doubles in the kernel. +if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_C_COMPILER_ID MATCHES "Clang") + ADD_CHECK_CXX_COMPILER_FLAG(CMAKE_CXX_FLAGS _has_cxxflag_float_conversion "-Werror=float-conversion") + ADD_CHECK_CXX_COMPILER_FLAG(CMAKE_CXX_FLAGS _has_cxxflag_double_promotion "-Werror=double-promotion") + unset(_has_cxxflag_float_conversion) + unset(_has_cxxflag_double_promotion) +endif() + cycles_add_library(cycles_kernel "${LIB}" ${SRC_KERNEL_DEVICE_CPU} ${SRC_KERNEL_DEVICE_CUDA} |