2023-08-16 00:20:26 +10:00
|
|
|
# SPDX-FileCopyrightText: 2020 Blender Authors
|
2023-06-14 22:49:59 +10:00
|
|
|
#
|
2022-02-11 09:07:11 +11:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
2020-11-17 12:06:35 +01:00
|
|
|
|
|
|
|
|
set(INC
|
|
|
|
|
.
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
set(INC_SYS
|
|
|
|
|
)
|
2023-07-29 13:47:57 +10:00
|
|
|
set(LIB
|
|
|
|
|
)
|
2020-11-17 12:06:35 +01:00
|
|
|
|
2023-06-27 20:57:50 +02:00
|
|
|
add_library(bf_intern_atomic INTERFACE)
|
2023-07-07 15:37:02 +02:00
|
|
|
|
2023-06-27 20:57:50 +02:00
|
|
|
target_include_directories(bf_intern_atomic INTERFACE .)
|
2023-07-07 15:37:02 +02:00
|
|
|
add_library(bf::intern::atomic ALIAS bf_intern_atomic)
|
2023-06-27 20:57:50 +02:00
|
|
|
|
|
|
|
|
# CMake 3.19+ allows one to populate the interface library with
|
|
|
|
|
# source files to show in the IDE, for people on older CMake versions
|
|
|
|
|
# these headers will be visible in the bf_intern_guardedalloc project
|
|
|
|
|
# where they historically have been.
|
|
|
|
|
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.19")
|
|
|
|
|
set(SRC
|
|
|
|
|
atomic_ops.h
|
|
|
|
|
intern/atomic_ops_ext.h
|
|
|
|
|
intern/atomic_ops_msvc.h
|
|
|
|
|
intern/atomic_ops_unix.h
|
|
|
|
|
intern/atomic_ops_utils.h
|
|
|
|
|
)
|
|
|
|
|
target_sources(bf_intern_atomic PRIVATE ${SRC})
|
|
|
|
|
blender_source_group(bf_intern_atomic ${SRC})
|
|
|
|
|
endif()
|
|
|
|
|
|
2020-11-17 12:06:35 +01:00
|
|
|
if(WITH_GTESTS)
|
|
|
|
|
set(TEST_SRC
|
|
|
|
|
tests/atomic_test.cc
|
|
|
|
|
)
|
|
|
|
|
set(TEST_INC
|
|
|
|
|
)
|
|
|
|
|
set(TEST_LIB
|
2023-06-27 20:57:50 +02:00
|
|
|
PRIVATE bf_intern_atomic
|
2020-11-17 12:06:35 +01:00
|
|
|
)
|
|
|
|
|
blender_add_test_executable(atomic "${TEST_SRC}" "${INC};${TEST_INC}" "${INC_SYS}" "${LIB};${TEST_LIB}")
|
|
|
|
|
endif()
|