File tree Expand file tree Collapse file tree 2 files changed +18
-8
lines changed Expand file tree Collapse file tree 2 files changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -8,10 +8,23 @@ add_subdirectory(utils)
8
8
9
9
set (UMF_LIBS umf_utils )
10
10
11
+ set (BA_SOURCES
12
+ ${CMAKE_CURRENT_SOURCE_DIR} /base_alloc/base_alloc.c
13
+ ${CMAKE_CURRENT_SOURCE_DIR} /base_alloc/base_alloc_linear.c
14
+ ${CMAKE_CURRENT_SOURCE_DIR} /base_alloc/base_alloc_global.c )
15
+
16
+ if (LINUX )
17
+ set (BA_SOURCES ${BA_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR} /base_alloc/base_alloc_linux.c )
18
+ elseif (WINDOWS )
19
+ set (BA_SOURCES ${BA_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR} /base_alloc/base_alloc_windows.c )
20
+ elseif (MACOSX )
21
+ set (BA_SOURCES ${BA_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR} /base_alloc/base_alloc_linux.c )
22
+ endif ()
23
+
24
+ set (BA_SOURCES ${BA_SOURCES} PARENT_SCOPE )
25
+
11
26
set (UMF_SOURCES
12
- base_alloc/base_alloc.c
13
- base_alloc/base_alloc_linear.c
14
- base_alloc/base_alloc_global.c
27
+ ${BA_SOURCES}
15
28
memory_pool.c
16
29
memory_provider.c
17
30
memory_provider_get_last_failed.c
@@ -22,17 +35,14 @@ set(UMF_SOURCES
22
35
)
23
36
24
37
set (UMF_SOURCES_LINUX
25
- base_alloc/base_alloc_linux.c
26
38
libumf_linux.c
27
39
)
28
40
29
41
set (UMF_SOURCES_WINDOWS
30
- base_alloc/base_alloc_windows.c
31
42
libumf_windows.c
32
43
)
33
44
34
45
set (UMF_SOURCES_MACOSX
35
- base_alloc/base_alloc_linux.c
36
46
libumf_linux.c
37
47
)
38
48
Original file line number Diff line number Diff line change @@ -118,9 +118,9 @@ endif()
118
118
if (LINUX )
119
119
# the base_alloc test uses linux pthreads
120
120
add_umf_test (NAME base_alloc
121
- SRCS test_base_alloc.c
121
+ SRCS ${BA_SOURCES} test_base_alloc.c
122
122
LIBS umf_utils )
123
123
add_umf_test (NAME base_alloc_linear
124
- SRCS test_base_alloc_linear.c
124
+ SRCS ${BA_SOURCES} test_base_alloc_linear.c
125
125
LIBS umf_utils )
126
126
endif ()
You can’t perform that action at this time.
0 commit comments