blender/intern/libc_compat/CMakeLists.txt
Sergey Sharybin cca416cfe6 Fix compilation on Linux, glibc 2.34, and CentOS libraries
A continuation of previous fix for malloc hooks which got removed
from the new glibc library.

The pre-compiled jemalloc has definitions which interpose hooks
in glibc leading to linking errors with multiple hook definitions.

A simple fix is to skip doing the workaround when using jemalloc
from pre-compiled libraries.

This will likely be revisited in the future, but for now it is
important to fix compilation errors for developers.
2022-09-13 10:38:42 +02:00

27 lines
421 B
CMake

# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2015 Blender Foundation. All rights reserved.
set(INC
.
)
set(INC_SYS
)
set(SRC
libc_compat.c
)
set(LIB
)
add_c_flag(-ffast-math)
blender_add_lib(bf_intern_libc_compat "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
if(WITH_LIBC_MALLOC_HOOK_WORKAROUND)
target_compile_definitions(bf_intern_libc_compat
PRIVATE WITH_LIBC_MALLOC_HOOK_WORKAROUND
)
endif()