-
Notifications
You must be signed in to change notification settings - Fork 2
/
sweater.cmake
115 lines (99 loc) · 4.02 KB
/
sweater.cmake
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#############################################################################
# (c) Copyright Domagoj Saric 2021 - 2024.
#
# Use, modification and distribution are subject to the
# Boost Software License, Version 1.0. (See accompanying file
# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# See http://www.boost.org for most recent version.
#############################################################################
set( src_root "${CMAKE_CURRENT_LIST_DIR}/include/boost/sweater" )
set( sweater_sources
${src_root}/spread_chunked.cpp
${src_root}/spread_chunked.hpp
${src_root}/sweater.hpp
)
set( sources_impls
${src_root}/impls/apple.hpp
${src_root}/impls/generic.cpp
${src_root}/impls/generic.hpp
${src_root}/impls/openmp.hpp
${src_root}/impls/single_threaded.hpp
${src_root}/impls/windows.hpp
)
source_group( "Impls" FILES ${sources_impls} )
list( APPEND sweater_sources ${sources_impls} )
set( sources_queues
${src_root}/queues/mpmc_moodycamel.hpp
)
source_group( "Queues" FILES ${sources_queues} )
list( APPEND sweater_sources ${sources_queues} )
set( sources_threading
${src_root}/threading/barrier.hpp
${src_root}/threading/futex.hpp
${src_root}/threading/futex_barrier.cpp
${src_root}/threading/futex_barrier.hpp
${src_root}/threading/futex_semaphore.cpp
${src_root}/threading/generic_barrier.cpp
${src_root}/threading/generic_barrier.hpp
${src_root}/threading/generic_semaphore.cpp
${src_root}/threading/hardware_concurrency.cpp
${src_root}/threading/hardware_concurrency.hpp
${src_root}/threading/rw_lock.hpp
${src_root}/threading/semaphore.hpp
${src_root}/threading/thread.hpp
)
source_group( "ThrdLite" FILES ${sources_threading} )
list( APPEND sweater_sources ${sources_threading} )
if ( APPLE )
set_source_files_properties( ${src_root}/threading/futex_barrier.cpp ${src_root}/threading/futex_semaphore.cpp PROPERTIES HEADER_FILE_ONLY ON )
else()
set_source_files_properties( ${src_root}/threading/generic_barrier.cpp ${src_root}/threading/generic_semaphore.cpp PROPERTIES HEADER_FILE_ONLY ON )
endif()
set( sources_threading_cpp
${src_root}/threading/cpp/spin_lock.cpp
${src_root}/threading/cpp/spin_lock.hpp
)
source_group( "ThrdLite/Cpp" FILES ${sources_threading_cpp} )
list( APPEND sweater_sources ${sources_threading_cpp} )
set( sources_threading_emscripten
${src_root}/threading/emscripten/futex.cpp
)
source_group( "ThrdLite/Emscripten" FILES ${sources_threading_emscripten} )
list( APPEND sweater_sources ${sources_threading_emscripten} )
if ( NOT EMSCRIPTEN )
set_source_files_properties( ${sources_threading_emscripten} PROPERTIES HEADER_FILE_ONLY ON )
endif()
set( sources_threading_linux
${src_root}/threading/linux/futex.cpp
)
source_group( "ThrdLite/Linux" FILES ${sources_threading_linux} )
list( APPEND sweater_sources ${sources_threading_linux} )
if ( NOT ANDROID AND NOT LINUX )
set_source_files_properties( ${sources_threading_linux} PROPERTIES HEADER_FILE_ONLY ON )
endif()
set( sources_threading_posix
${src_root}/threading/posix/condvar.hpp
${src_root}/threading/posix/mutex.hpp
${src_root}/threading/posix/rw_lock.hpp
${src_root}/threading/posix/semaphore.hpp
${src_root}/threading/posix/thread.cpp
${src_root}/threading/posix/thread.hpp
)
source_group( "ThrdLite/POSIX" FILES ${sources_threading_posix} )
list( APPEND sweater_sources ${sources_threading_posix} )
if ( WIN32 )
set_source_files_properties( ${sources_threading_posix} PROPERTIES HEADER_FILE_ONLY ON )
endif()
set( sources_threading_windows
${src_root}/threading/windows/condvar.hpp
${src_root}/threading/windows/futex.cpp
${src_root}/threading/windows/mutex.hpp
${src_root}/threading/windows/rw_lock.hpp
${src_root}/threading/windows/thread.hpp
)
source_group( "ThrdLite/Windows" FILES ${sources_threading_windows} )
list( APPEND sweater_sources ${sources_threading_windows} )
if ( NOT WIN32 )
set_source_files_properties( ${sources_threading_windows} PROPERTIES HEADER_FILE_ONLY ON )
endif()