-
Notifications
You must be signed in to change notification settings - Fork 108
/
Copy pathCMakeLists.txt
116 lines (106 loc) · 3.55 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
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
116
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------------
# Copyright © 2011-2015, RedJack, LLC.
# All rights reserved.
#
# Please see the COPYING file in this distribution for license details.
# ----------------------------------------------------------------------
#-----------------------------------------------------------------------
# libcork
# Update the VERSION_INFO property below according to the following rules (taken
# from [1]):
#
# VERSION_INFO = current:revision:age
#
# 1. Start with a VERSION of `0:0:0` for each shared library.
# 2. Update VERSION_INFO only immediately before a public release of your
# software. More frequent updates are unnecessary, and only guarantee that
# the current interface number gets larger faster.
# 3. If the library source code has changed at all since the last update, then
# increment `revision` (`c:r:a` becomes `c:r+1:a`).
# 4. If any interfaces have been added, removed, or changed since the last
# update, increment `current`, and set `revision` to 0.
# 5. If any interfaces have been added since the last public release, then
# increment `age`.
# 6. If any interfaces have been removed or changed since the last public
# release, then set `age` to 0.
#
# Note that changing `current` and setting `age` to 0 means that you are
# releasing a new backwards-incompatible version of the library. This has
# implications on packaging, so once an API has stabilized, this should be a
# rare occurrence.
#
# [1] http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info
add_c_library(
libcork
OUTPUT_NAME cork
PKGCONFIG_NAME libcork
VERSION_INFO 16:3:0
SOURCES
libcork/cli/commands.c
libcork/core/allocator.c
libcork/core/error.c
libcork/core/gc.c
libcork/core/hash.c
libcork/core/ip-address.c
libcork/core/mempool.c
libcork/core/timestamp.c
libcork/core/u128.c
libcork/core/version.c
libcork/ds/array.c
libcork/ds/bitset.c
libcork/ds/buffer.c
libcork/ds/dllist.c
libcork/ds/file-stream.c
libcork/ds/hash-table.c
libcork/ds/managed-buffer.c
libcork/ds/ring-buffer.c
libcork/ds/slice.c
libcork/posix/directory-walker.c
libcork/posix/env.c
libcork/posix/exec.c
libcork/posix/files.c
libcork/posix/process.c
libcork/posix/subprocess.c
libcork/pthreads/thread.c
LIBRARIES
threads
)
if (ENABLE_SHARED OR ENABLE_SHARED_EXECUTABLES)
set_target_properties(libcork-shared PROPERTIES
COMPILE_DEFINITIONS CORK_API=CORK_EXPORT
)
endif (ENABLE_SHARED OR ENABLE_SHARED_EXECUTABLES)
if (ENABLE_STATIC OR NOT ENABLE_SHARED_EXECUTABLES)
set_target_properties(libcork-static PROPERTIES
COMPILE_DEFINITIONS CORK_API=CORK_LOCAL
)
endif (ENABLE_STATIC OR NOT ENABLE_SHARED_EXECUTABLES)
#-----------------------------------------------------------------------
# Utility commands
add_c_executable(
cork-hash
OUTPUT_NAME cork-hash
SOURCES cork-hash/cork-hash.c
LOCAL_LIBRARIES
libcork
)
add_c_executable(
cork-initializer
SKIP_INSTALL
OUTPUT_NAME cork-initializer
SOURCES
cork-initializer/init1.c
cork-initializer/init2.c
cork-initializer/main.c
LOCAL_LIBRARIES
libcork
)
add_c_executable(
cork-test
SKIP_INSTALL
OUTPUT_NAME cork-test
SOURCES cork-test/cork-test.c
LOCAL_LIBRARIES
libcork
)