Changeset View
Changeset View
Standalone View
Standalone View
intern/guardedalloc/CMakeLists.txt
| # SPDX-License-Identifier: GPL-2.0-or-later | # SPDX-License-Identifier: GPL-2.0-or-later | ||||
| # Copyright 2006 Blender Foundation. All rights reserved. | # Copyright 2006 Blender Foundation. All rights reserved. | ||||
| set(INC | set(INC | ||||
| . | PUBLIC . | ||||
| ../atomic | |||||
| ) | ) | ||||
| set(INC_SYS | set(INC_SYS | ||||
| ) | ) | ||||
| set(SRC | set(SRC | ||||
| ./intern/leak_detector.cc | ./intern/leak_detector.cc | ||||
| ./intern/mallocn.c | ./intern/mallocn.c | ||||
| ./intern/mallocn_guarded_impl.c | ./intern/mallocn_guarded_impl.c | ||||
| ./intern/mallocn_lockfree_impl.c | ./intern/mallocn_lockfree_impl.c | ||||
| MEM_guardedalloc.h | MEM_guardedalloc.h | ||||
| ./intern/mallocn_inline.h | ./intern/mallocn_inline.h | ||||
| ./intern/mallocn_intern.h | ./intern/mallocn_intern.h | ||||
| ) | |||||
| # CMake 3.19+ allows source files to be set on interface libraries. | |||||
| # So for CMake 3.19+ these files will be visible in the bf_intern_atomic | |||||
| # subproject in the IDE, for people on older versions we keep the files | |||||
| # in the old location. This can be cleaned up once we bump CMake version | |||||
| # to 3.19 or newer. | |||||
| if(${CMAKE_VERSION} VERSION_LESS "3.19") | |||||
| list(APPEND SRC | |||||
| # only so the header is known by cmake | # only so the header is known by cmake | ||||
| ../atomic/atomic_ops.h | ../atomic/atomic_ops.h | ||||
| ../atomic/intern/atomic_ops_ext.h | ../atomic/intern/atomic_ops_ext.h | ||||
| ../atomic/intern/atomic_ops_msvc.h | ../atomic/intern/atomic_ops_msvc.h | ||||
| ../atomic/intern/atomic_ops_unix.h | ../atomic/intern/atomic_ops_unix.h | ||||
| ../atomic/intern/atomic_ops_utils.h | ../atomic/intern/atomic_ops_utils.h | ||||
| ) | ) | ||||
| endif() | |||||
| set(LIB | set(LIB | ||||
| PRIVATE bf_intern_atomic | |||||
| ) | ) | ||||
| if(WIN32 AND NOT UNIX) | if(WIN32 AND NOT UNIX) | ||||
| list(APPEND INC_SYS | list(APPEND INC_SYS | ||||
| ${PTHREADS_INC} | ${PTHREADS_INC} | ||||
| ) | ) | ||||
| list(APPEND LIB | list(APPEND LIB | ||||
| Show All 21 Lines | set(TEST_SRC | ||||
| tests/guardedalloc_alignment_test.cc | tests/guardedalloc_alignment_test.cc | ||||
| tests/guardedalloc_overflow_test.cc | tests/guardedalloc_overflow_test.cc | ||||
| tests/guardedalloc_test_base.h | tests/guardedalloc_test_base.h | ||||
| ) | ) | ||||
| set(TEST_INC | set(TEST_INC | ||||
| ../../source/blender/blenlib | ../../source/blender/blenlib | ||||
| ) | ) | ||||
| set(TEST_LIB | set(TEST_LIB | ||||
| bf_intern_guardedalloc | PRIVATE bf_intern_guardedalloc | ||||
| bf_blenlib | bf_blenlib | ||||
| ) | ) | ||||
| include(GTestTesting) | include(GTestTesting) | ||||
| blender_add_test_executable(guardedalloc "${TEST_SRC}" "${INC};${TEST_INC}" "${INC_SYS}" "${LIB};${TEST_LIB}") | blender_add_test_executable(guardedalloc "${TEST_SRC}" "${INC};${TEST_INC}" "${INC_SYS}" "${LIB};${TEST_LIB}") | ||||
| endif() | endif() | ||||