Repository navigation
Expand file tree
/
Copy pathsophia.gyp
More file actions
120 lines (118 loc) · 3.35 KB
/
Copy pathsophia.gyp
File metadata and controls
120 lines (118 loc) · 3.35 KB
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
117
118
119
120
{
'variables': {
'target_arch%': 'ia32', # set target architecture
'host_arch%': 'ia32', # set host architecture
'sophia_library%': 'static_library', # allow override to 'shared_library' for DLL/.so builds
},
'target_defaults': {
'default_configuration': 'Release',
'configurations': {
'Debug': {
'defines': [ 'DEBUG' ],
'cflags': [
'-std=c99',
'-pedantic',
'-Wall',
'-Wextra',
'-fvisibility=hidden',
'-g',
'-O0'
],
'xcode_settings': {
'GCC_OPTIMIZATION_LEVEL': '0',
},
},
'Release': {
'defines': [ 'NDEBUG' ],
'cflags': [
'-std=c99',
'-pedantic',
'-Wall',
'-Wextra',
'-fvisibility=hidden',
'-O2'
],
}
},
'conditions': [
['OS in "freebsd linux openbsd solaris android"', {
'target_conditions': [
['_type=="static_library"', {
'standalone_static_library': 1, # disable thin archive which needs binutils >= 2.19
}],
],
'conditions': [
[ 'host_arch != target_arch and target_arch=="ia32"', {
'cflags': [ '-m32' ],
'ldflags': [ '-m32' ],
}],
[ 'OS=="solaris"', {
'cflags': [ '-pthreads' ],
'ldflags': [ '-pthreads' ],
}],
[ 'OS != "solaris"', {
'cflags': [ '-pthread' ],
'ldflags': [ '-pthread' ],
}],
],
}],
['OS=="mac"', {
'xcode_settings': {
'ALWAYS_SEARCH_USER_PATHS': 'NO',
'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic (Equivalent to -fPIC)
'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES', # -fvisibility-inlines-hidden
'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
'PREBINDING': 'NO', # No -Wl,-prebind
'USE_HEADERMAP': 'NO',
},
'conditions': [
['target_arch=="ia32"', {
'xcode_settings': {'ARCHS': ['i386']},
}],
['target_arch=="x64"', {
'xcode_settings': {'ARCHS': ['x86_64']},
}],
],
'target_conditions': [
['_type!="static_library"', {
'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
}],
],
}],
],
},
'targets': [
{
'target_name': 'sophia',
'product_prefix': 'lib',
'type': '<(sophia_library)',
'include_dirs': ['db'],
'link_settings': {
'libraries': ['-lpthread'],
},
'direct_dependent_settings': {
'include_dirs': ['db'],
},
'sources': [
'db/cat.c',
'db/crc.c',
'db/cursor.c',
'db/e.c',
'db/file.c',
'db/gc.c',
'db/i.c',
'db/merge.c',
'db/recover.c',
'db/rep.c',
'db/sp.c',
'db/util.c',
],
},
],
}