Lock-free memory allocator
[blender-staging.git] / source / blender / makesdna / intern / CMakeLists.txt
1 # ***** BEGIN GPL LICENSE BLOCK *****
2 #
3 # This program is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License
5 # as published by the Free Software Foundation; either version 2
6 # of the License, or (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software Foundation,
15 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 #
17 # The Original Code is Copyright (C) 2006, Blender Foundation
18 # All rights reserved.
19 #
20 # The Original Code is: all of this file.
21 #
22 # Contributor(s): Jacques Beaurain.
23 #
24 # ***** END GPL LICENSE BLOCK *****
25
26 # message(STATUS "Configuring makesdna")
27
28 add_definitions(-DWITH_DNA_GHASH)
29
30 blender_include_dirs(
31         ../../../../intern/guardedalloc
32         ../../../../intern/atomic
33         ../../blenlib
34         ..
35 )
36
37
38 # -----------------------------------------------------------------------------
39 # Build makesdna executable
40 set(SRC
41         makesdna.c
42         ../../../../intern/guardedalloc/intern/mallocn.c
43         ../../../../intern/guardedalloc/intern/mallocn_guarded_impl.c
44         ../../../../intern/guardedalloc/intern/mallocn_lockfree_impl.c
45 )
46
47 if(WIN32 AND NOT UNIX)
48         list(APPEND SRC
49                 ../../../../intern/guardedalloc/intern/mmap_win.c
50         )
51 endif()
52
53 # SRC_DNA_INC is defined in the parent dir
54
55 add_executable(makesdna ${SRC} ${SRC_DNA_INC})
56
57 # Output dna.c
58 add_custom_command(
59         OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/dna.c
60         COMMAND ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/makesdna ${CMAKE_CURRENT_BINARY_DIR}/dna.c ${CMAKE_SOURCE_DIR}/source/blender/makesdna/
61         DEPENDS makesdna
62 )
63
64
65 # -----------------------------------------------------------------------------
66 # Build bf_dna library
67 set(INC
68
69 )
70
71 set(INC_SYS
72
73 )
74
75 set(SRC
76         dna_genfile.c
77         dna.c
78         ${SRC_DNA_INC}
79 )
80
81 set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/dna.c PROPERTIES GENERATED TRUE)
82
83 blender_add_lib(bf_dna "${SRC}" "${INC}" "${INC_SYS}")
84
85
86 # -----------------------------------------------------------------------------
87 # Build bf_dna_blenlib library
88 set(INC
89
90 )
91
92 set(INC_SYS
93
94 )
95
96 set(SRC
97         ../../blenlib/intern/BLI_mempool.c
98         ../../blenlib/intern/listbase.c
99         ../../blenlib/intern/BLI_ghash.c
100 )
101
102 blender_add_lib(bf_dna_blenlib "${SRC}" "${INC}" "${INC_SYS}")