forked from bartvdbraak/blender
tweaks to clang so blender can build with -Werror
This commit is contained in:
parent
21dc93d275
commit
6a51379bf7
@ -1992,6 +1992,10 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|||||||
# ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_UNUSED_MACROS -Wunused-macros)
|
# ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_UNUSED_MACROS -Wunused-macros)
|
||||||
# ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNUSED_MACROS -Wunused-macros)
|
# ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNUSED_MACROS -Wunused-macros)
|
||||||
|
|
||||||
|
# flags to undo strict flags
|
||||||
|
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_PARAMETER -Wno-unused-parameter)
|
||||||
|
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_MACROS -Wno-unused-macros)
|
||||||
|
|
||||||
elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
|
elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
|
||||||
|
|
||||||
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ALL -Wall)
|
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ALL -Wall)
|
||||||
|
@ -504,6 +504,9 @@ macro(remove_strict_flags)
|
|||||||
remove_cc_flag("-Wunused-variable")
|
remove_cc_flag("-Wunused-variable")
|
||||||
remove_cc_flag("-Werror=[^ ]+")
|
remove_cc_flag("-Werror=[^ ]+")
|
||||||
remove_cc_flag("-Werror")
|
remove_cc_flag("-Werror")
|
||||||
|
|
||||||
|
# negate flags implied by '-Wall'
|
||||||
|
add_cc_flag("${CC_REMOVE_STRICT_FLAGS}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
class IOCIOImpl {
|
class IOCIOImpl {
|
||||||
public:
|
public:
|
||||||
virtual ~IOCIOImpl() {};
|
virtual ~IOCIOImpl() {}
|
||||||
|
|
||||||
virtual OCIO_ConstConfigRcPtr *getCurrentConfig(void) = 0;
|
virtual OCIO_ConstConfigRcPtr *getCurrentConfig(void) = 0;
|
||||||
virtual void setCurrentConfig(const OCIO_ConstConfigRcPtr *config) = 0;
|
virtual void setCurrentConfig(const OCIO_ConstConfigRcPtr *config) = 0;
|
||||||
@ -99,7 +99,7 @@ public:
|
|||||||
|
|
||||||
class FallbackImpl : public IOCIOImpl {
|
class FallbackImpl : public IOCIOImpl {
|
||||||
public:
|
public:
|
||||||
FallbackImpl() {};
|
FallbackImpl() {}
|
||||||
|
|
||||||
OCIO_ConstConfigRcPtr *getCurrentConfig(void);
|
OCIO_ConstConfigRcPtr *getCurrentConfig(void);
|
||||||
void setCurrentConfig(const OCIO_ConstConfigRcPtr *config);
|
void setCurrentConfig(const OCIO_ConstConfigRcPtr *config);
|
||||||
|
@ -2218,6 +2218,13 @@ void barycentric_weights_v2_quad(const float v1[2], const float v2[2], const flo
|
|||||||
len_v2(dirs[3]),
|
len_v2(dirs[3]),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* variable 'area' is just for storage,
|
||||||
|
* the order its initialized doesn't matter */
|
||||||
|
#ifdef __clang__
|
||||||
|
# pragma clang diagnostic push
|
||||||
|
# pragma clang diagnostic ignored "-Wunsequenced"
|
||||||
|
#endif
|
||||||
|
|
||||||
/* inline mean_value_half_tan four times here */
|
/* inline mean_value_half_tan four times here */
|
||||||
float t[4] = {
|
float t[4] = {
|
||||||
MEAN_VALUE_HALF_TAN_V2(area, 0, 1),
|
MEAN_VALUE_HALF_TAN_V2(area, 0, 1),
|
||||||
@ -2226,6 +2233,10 @@ void barycentric_weights_v2_quad(const float v1[2], const float v2[2], const flo
|
|||||||
MEAN_VALUE_HALF_TAN_V2(area, 3, 0),
|
MEAN_VALUE_HALF_TAN_V2(area, 3, 0),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef __clang__
|
||||||
|
# pragma clang diagnostic pop
|
||||||
|
#endif
|
||||||
|
|
||||||
#undef MEAN_VALUE_HALF_TAN_V2
|
#undef MEAN_VALUE_HALF_TAN_V2
|
||||||
|
|
||||||
w[0] = (t[3] + t[0]) / lens[0];
|
w[0] = (t[3] + t[0]) / lens[0];
|
||||||
|
Loading…
Reference in New Issue
Block a user