summaryrefslogtreecommitdiff
path: root/src/lib/eina
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>2017-01-19 09:16:36 +0100
committerMarcel Hollerbach <marcel-hollerbach@t-online.de>2017-01-23 18:23:40 +0100
commit88283204c16c745e3aec11bff2409bd5cc903121 (patch)
tree0e9177d2dc85eb8ba5b75204a9569c75b219ba72 /src/lib/eina
parentc1c30cc6ce435021084f30567fa6ec9cd939e0b5 (diff)
build: switch eina to half baked cmake
Diffstat (limited to 'src/lib/eina')
-rw-r--r--src/lib/eina/CMakeLists.txt214
-rw-r--r--src/lib/eina/eina_config.h.cmake145
2 files changed, 359 insertions, 0 deletions
diff --git a/src/lib/eina/CMakeLists.txt b/src/lib/eina/CMakeLists.txt
new file mode 100644
index 0000000000..56b6f6733d
--- /dev/null
+++ b/src/lib/eina/CMakeLists.txt
@@ -0,0 +1,214 @@
1INCLUDE (CheckSymbolExists)
2INCLUDE (CheckIncludeFile)
3INCLUDE (CheckTypeSize)
4INCLUDE (FindPkgConfig)
5find_package(Threads REQUIRED)
6
7#Configure depending on the profile
8set(EINA_SAFETY_CHECKS 1)
9if ("${BUILD_PROFILE}" STREQUAL "dev")
10 set(EINA_STRINGSHARE_USAGE ON)
11 set(CHECK_VALGRIND ON)
12elseif ("${BUILD_PROFILE}" STREQUAL "debug")
13 set(EINA_DEBUG_MALLOC ON)
14 set(EINA_COW_MAGIC_ON ON)
15 set(EINA_DEFAULT_MEMPOOL ON)
16 set(EINA_DEBUG_MALLOC ON)
17 set(EINA_DEBUG_THREADS ON)
18 set(VALGRIND ON)
19elseif ("${BUILD_PROFILE}" STREQUAL "release")
20 set(EINA_LOG_LEVEL_MAXIMUM 3)
21endif ("${BUILD_PROFILE}" STREQUAL "dev")
22
23#options of that submodule
24option(EINA_MAGIC_DEBUG "magic debug of eina structure" ON)
25option(EINA_DEBUG_THREADS "debugging of eina threads" ${EINA_DEBUG_THREADS})
26option(VALGRIND "valgrind support" ${VALGRIND})
27
28#check for symbols in pthread
29#TODO Make the definitions depending on the platform
30set(CMAKE_REQUIRED_FLAGS "${CMAKE_THREAD_LIBS_INIT}")
31set(CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE=1")
32CHECK_SYMBOL_EXISTS(pthread_barrier_init pthread.h EINA_HAVE_PTHREAD_BARRIER)
33CHECK_SYMBOL_EXISTS(pthread_attr_setaffinity_np pthread.h EINA_HAVE_PTHREAD_AFFINITY)
34CHECK_SYMBOL_EXISTS(pthread_setname_np pthread.h EINA_HAVE_PTHREAD_SETNAME)
35CHECK_SYMBOL_EXISTS(pthread_spin_init pthread.h EINA_HAVE_POSIX_SPINLOCK)
36
37#check for eina header files that are required
38CHECK_INCLUDE_FILE(alloca.h EINA_HAVE_ALLOCA_H)
39CHECK_INCLUDE_FILE(byteswap.h EINA_HAVE_BYTESWAP_H)
40CHECK_INCLUDE_FILE(fnmatch.h EINA_HAVE_FNMATCH_H)
41#only enable log when fnmatch is there
42if (EINA_HAVE_FNMATCH_H)
43 set(EINA_ENABLE_LOG 1)
44endif (EINA_HAVE_FNMATCH_H)
45CHECK_INCLUDE_FILE(dirent.h EINA_HAVE_DIRENT_H)
46
47CHECK_TYPE_SIZE("wchar_t" EINA_SIZEOF_WCHAR_T)
48CHECK_TYPE_SIZE("uintptr_t" EINA_SIZEOF_UINTPTR_T)
49CHECK_TYPE_SIZE("wchar_t" EINA_SIZEOF_WCHAR_T)
50
51#check for swap16/32/64
52CHECK_SYMBOL_EXISTS(bswap_16 byteswap.h EINA_HAVE_BSWAP16)
53CHECK_SYMBOL_EXISTS(bswap_32 byteswap.h EINA_HAVE_BSWAP32)
54CHECK_SYMBOL_EXISTS(bswap_64 byteswap.h EINA_HAVE_BSWAP64)
55
56#TODO really check if we wanted to have valgrind support or not
57pkg_check_modules(VG REQUIRED valgrind)
58
59#Check if there is the alloca header
60
61configure_file(eina_config.h.cmake ${CMAKE_CURRENT_SOURCE_DIR}/eina_config.h)
62
63include_directories(
64 ${PROJECT_SOURCE_DIR}/
65 ${VG_INCLUDE_DIRS}
66 ${PROJECT_SOURCE_DIR}/src/lib/efl
67 ${PROJECT_SOURCE_DIR}/src/lib/eina
68)
69
70LIST(APPEND eina_source
71 Eina.h
72 eina_abi.c
73 eina_accessor.c
74 eina_accessor.h
75 eina_alloca.h
76 eina_array.c
77 eina_array.h
78 eina_benchmark.c
79 eina_benchmark.h
80 eina_bezier.c
81 eina_bezier.h
82 eina_binbuf.c
83 eina_binbuf.h
84 eina_binshare.c
85 eina_binshare.h
86 eina_clist.h
87 eina_config.h
88 eina_convert.c
89 eina_convert.h
90 eina_counter.c
91 eina_counter.h
92 eina_cow.c
93 eina_cow.h
94 eina_cpu.c
95 eina_cpu.h
96 eina_crc.c
97 eina_crc.h
98 eina_debug.c
99 eina_debug.h
100 eina_debug_bt.c
101 eina_debug_bt_file.c
102 eina_debug_chunk.c
103 eina_debug_monitor.c
104 eina_debug_proto.c
105 eina_debug_thread.c
106 eina_error.c
107 eina_error.h
108 eina_evlog.c
109 eina_evlog.h
110 eina_file.c
111 eina_file.h
112 eina_file_common.c
113 eina_file_common.h
114 eina_fp.c
115 eina_fp.h
116 eina_freeq.c
117 eina_freeq.h
118 eina_hamster.c
119 eina_hamster.h
120 eina_hash.c
121 eina_hash.h
122 eina_inarray.c
123 eina_inarray.h
124 eina_inline_private.h
125 eina_inlist.c
126 eina_inlist.h
127 eina_iterator.c
128 eina_iterator.h
129 eina_lalloc.c
130 eina_lalloc.h
131 eina_list.c
132 eina_list.h
133 eina_lock.c
134 eina_lock.h
135 eina_log.c
136 eina_log.h
137 eina_magic.c
138 eina_magic.h
139 eina_main.c
140 eina_main.h
141 eina_matrix.c
142 eina_matrix.h
143 eina_matrixsparse.c
144 eina_matrixsparse.h
145 eina_mempool.c
146 eina_mempool.h
147 eina_mmap.c
148 eina_mmap.h
149 eina_module.c
150 eina_module.h
151 eina_prefix.c
152 eina_prefix.h
153 eina_private.h
154 eina_quad.c
155 eina_quad.h
156 eina_quadtree.c
157 eina_quadtree.h
158 eina_quaternion.c
159 eina_quaternion.h
160 eina_rbtree.c
161 eina_rbtree.h
162 eina_rectangle.c
163 eina_rectangle.h
164 eina_refcount.h
165 eina_safepointer.c
166 eina_safepointer.h
167 eina_safety_checks.c
168 eina_safety_checks.h
169 eina_sched.c
170 eina_sched.h
171 eina_share_common.c
172 eina_share_common.h
173 eina_simple_xml_parser.c
174 eina_simple_xml_parser.h
175 eina_slice.h
176 eina_slstr.c
177 eina_slstr.h
178 eina_str.c
179 eina_str.h
180 eina_strbuf.c
181 eina_strbuf.h
182 eina_strbuf_common.c
183 eina_strbuf_common.h
184 eina_strbuf_template_c.x
185 eina_stringshare.c
186 eina_stringshare.h
187 eina_thread.c
188 eina_thread.h
189 eina_thread_queue.c
190 eina_thread_queue.h
191 eina_tiler.c
192 eina_tiler.h
193 eina_tmpstr.c
194 eina_tmpstr.h
195 eina_trash.h
196 eina_types.h
197 eina_unicode.c
198 eina_unicode.h
199 eina_ustrbuf.c
200 eina_ustrbuf.h
201 eina_ustringshare.c
202 eina_ustringshare.h
203 eina_util.c
204 eina_util.h
205 eina_value.c
206 eina_value.h
207 eina_value_util.c
208 eina_value_util.h
209 eina_vector.h
210 eina_xattr.c
211 eina_xattr.h
212)
213
214add_library(eina SHARED ${eina_source}) \ No newline at end of file
diff --git a/src/lib/eina/eina_config.h.cmake b/src/lib/eina/eina_config.h.cmake
new file mode 100644
index 0000000000..a4aac7d99f
--- /dev/null
+++ b/src/lib/eina/eina_config.h.cmake
@@ -0,0 +1,145 @@
1/* EINA - EFL data type library
2 * Copyright (C) 2008 Cedric Bail
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library;
16 * if not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef EINA_CONFIG_H_
20#define EINA_CONFIG_H_
21
22#ifdef HAVE_EXOTIC
23# include <Exotic.h>
24#endif
25
26#ifdef EINA_MAGIC_DEBUG
27# undef EINA_MAGIC_DEBUG
28#endif
29#cmakedefine EINA_MAGIC_DEBUG
30
31#ifndef EINA_DEFAULT_MEMPOOL
32# undef EINA_DEFAULT_MEMPOOL
33#endif
34#cmakedefine EINA_DEFAULT_MEMPOOL
35
36#ifdef EINA_SAFETY_CHECKS
37# undef EINA_SAFETY_CHECKS
38#endif
39#cmakedefine EINA_SAFETY_CHECKS
40
41#ifndef EINA_HAVE_THREADS
42#define EINA_HAVE_THREADS
43#endif
44
45#ifdef EINA_HAVE_PTHREAD_AFFINITY
46# undef EINA_HAVE_PTHREAD_AFFINITY
47#endif
48#cmakedefine EINA_HAVE_PTHREAD_AFFINITY
49
50#ifdef EINA_HAVE_PTHREAD_BARRIER
51# undef EINA_HAVE_PTHREAD_BARRIER
52#endif
53#cmakedefine EINA_HAVE_PTHREAD_BARRIER
54
55#ifdef EINA_HAVE_PTHREAD_SETNAME
56# undef EINA_HAVE_PTHREAD_SETNAME
57#endif
58#cmakedefine EINA_HAVE_PTHREAD_SETNAME
59
60#ifdef EINA_HAVE_DEBUG_THREADS
61# undef EINA_HAVE_DEBUG_THREADS
62#endif
63#cmakedefine EINA_HAVE_DEBUG_THREADS
64
65#ifdef EINA_SIZEOF_WCHAR_T
66# undef EINA_SIZEOF_WCHAR_T
67#endif
68#cmakedefine EINA_SIZEOF_WCHAR_T @EINA_SIZEOF_WCHAR_T@
69
70#ifdef EINA_SIZEOF_UINTPTR_T
71# undef EINA_SIZEOF_UINTPTR_T
72#endif
73#cmakedefine EINA_SIZEOF_UINTPTR_T @EINA_SIZEOF_UINTPTR_T@
74
75#ifdef EINA_CONFIGURE_HAVE_DIRENT_H
76# undef EINA_CONFIGURE_HAVE_DIRENT_H
77#endif
78#cmakedefine EINA_HAVE_DIRENT_H
79
80#ifdef EINA_CONFIGURE_ENABLE_LOG
81# undef EINA_CONFIGURE_ENABLE_LOG
82#endif
83#cmakedefine EINA_ENABLE_LOG
84
85#ifdef EINA_HAVE_ALLOCA_H
86# undef EINA_HAVE_ALLOCA_H
87#endif
88#cmakedefine EINA_HAVE_ALLOCA_H
89
90#ifdef EINA_HAVE_BSWAP16
91# undef EINA_HAVE_BSWAP16
92#endif
93#cmakedefine EINA_HAVE_BSWAP16
94
95#ifdef EINA_HAVE_BSWAP32
96# undef EINA_HAVE_BSWAP32
97#endif
98#cmakedefine EINA_HAVE_BSWAP32
99
100#ifdef EINA_HAVE_BSWAP64
101# undef EINA_HAVE_BSWAP64
102#endif
103#cmakedefine EINA_HAVE_BSWAP64
104
105#ifdef EINA_HAVE_BYTESWAP_H
106# undef EINA_HAVE_BYTESWAP_H
107#endif
108#cmakedefine EINA_HAVE_BYTESWAP_H
109
110#ifdef EINA_HAVE_POSIX_SPINLOCK
111# undef EINA_HAVE_POSIX_SPINLOCK
112#endif
113#cmakedefine EINA_HAVE_POSIX_SPINLOCK
114
115#ifndef EINA_HAVE_OSX_SPINLOCK
116# undef EINA_HAVE_OSX_SPINLOCK
117#endif
118@EINA_CONFIGURE_HAVE_OSX_SPINLOCK@
119
120#ifndef EINA_HAVE_OSX_SEMAPHORE
121# undef EINA_HAVE_OSX_SEMAPHORE
122#endif
123@EINA_CONFIGURE_HAVE_OSX_SEMAPHORE@
124
125#include <limits.h>
126
127#ifndef __WORDSIZE
128# if defined(__OPENBSD__) && (INTPTR_MAX == INT32_MAX)
129# define __WORDSIZE 32
130# else
131# define __WORDSIZE 64
132# endif
133#endif
134
135/* Do not turn the following #define as meaning EFL64. We are only
136 interested to know if sizeof (void*) == 64bits or not. Those means
137 something else.
138
139 defined(__x86_64__) || defined(__x86_64) || defined(__amd64__) || defined(__amd64)
140 */
141#if defined(_WIN64) || defined(__LP64__) || defined(_LP64) || defined(__ppc64__)
142# define EFL64
143#endif
144
145#endif /* EINA_CONFIG_H_ */