-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
55 lines (43 loc) · 1.37 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
cmake_minimum_required(VERSION 3.12...3.16)
project(threadsafe
DESCRIPTION "Threading utilities: object oriented (read/write) locking and more"
LANGUAGES CXX
)
include(AICxxProject)
#==============================================================================
# BUILD PROJECT
#
# This project is an OBJECT-library, used by other git submodules and the main project.
add_library(threadsafe_ObjLib OBJECT)
# The list of source files.
target_sources(threadsafe_ObjLib
PRIVATE
"PointerStorage.cxx"
"AIMutex.h"
"AIReadWriteMutex.h"
"AIReadWriteSpinLock.h"
"ConditionVariable.h"
"PointerStorage.h"
"ObjectTracker.h"
"ObjectTracker.inl.h"
"threadsafe.h"
)
# Required include search-paths.
get_target_property(CWDS_INTERFACE_INCLUDE_DIRECTORIES AICxx::cwds INTERFACE_INCLUDE_DIRECTORIES)
target_include_directories(threadsafe_ObjLib
PUBLIC
"${CWDS_INTERFACE_INCLUDE_DIRECTORIES}" # For sys.h and debug.h.
)
# Require support for C++17.
target_compile_features(threadsafe_ObjLib
PUBLIC cxx_std_17
)
# Set link dependencies.
target_link_libraries(threadsafe_ObjLib
PUBLIC
AICxx::utils
)
# Create an ALIAS target.
add_library(AICxx::threadsafe ALIAS threadsafe_ObjLib)
# Prepend this object library to the list.
set(AICXX_OBJECTS_LIST AICxx::threadsafe ${AICXX_OBJECTS_LIST} CACHE INTERNAL "List of OBJECT libaries that this project uses.")