forked from pxscene/pxCore2
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcommon.sh
141 lines (111 loc) · 3.35 KB
/
common.sh
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
#
# Author: Damian Wrobel <dwrobel@ertelnet.rybnik.pl>
#
# Groups of compilation options used to build
# tested versions of Spark
#
# Available groups | Group Description
# -----------------------------------------------------
# CMAKE options
# -----------------------------------------------------
# spark_common_opts - used by all tested versions
# spark_force_node6 - used to force build with node 6
# spark_force_node8 - used to force build with node 8
# spark_glut_opts - options to build GLUT backend
# spark_wayland_opts - options to build Wayland backend
# -----------------------------------------------------
# Compiler options
# -----------------------------------------------------
# cxx_common_opts - options shared by gcc and clang
# clang_specific_opts - clang specific options
# gcc_specific_opts - gcc specific options
# gcc_asan_opts - gcc AddressSanitizer options
# gcc_tsan_opts - gcc ThreadSanitizer options
spark_common_opts=(
'-DBUILD_RTREMOTE_LIBS=ON'
'-DBUILD_PXSCENE_RASTERIZER_PATH=ON'
'-DBUILD_WITH_STATIC_NODE=OFF'
'-DPREFER_SYSTEM_LIBRARIES=ON'
'-DBUILD_DEBUG_METRICS=ON'
# TODO: to be removed
'-DPXSCENE_COMPILE_WARNINGS_AS_ERRORS=OFF'
'-DPXCORE_COMPILE_WARNINGS_AS_ERRORS=OFF'
)
spark_glut_opts=(
'-DBUILD_PX_TESTS=ON'
'-DPXSCENE_TEST_HTTP_CACHE=OFF'
'-DBUILD_PXSCENE_STATIC_LIB=ON'
)
spark_wayland_opts=(
'-DPXCORE_WAYLAND_DISPLAY_READ_EVENTS=OFF'
'-DPXCORE_MATRIX_HELPERS=OFF'
'-DPXSCENE_DIRTY_RECTANGLES=ON'
'-DPXCORE_WAYLAND_EGL=ON'
'-DBUILD_PXSCENE_WAYLAND_EGL=ON'
'-DBUILD_WITH_GL=ON'
'-DBUILD_WITH_WAYLAND=ON'
'-DBUILD_PXSCENE_SHARED_LIB=OFF'
'-DBUILD_PXSCENE_APP=ON'
)
spark_force_node6=(
'-DPKG_CONFIG_DISABLE_NODE=OFF'
'-DPKG_CONFIG_DISABLE_NODE8=ON'
)
spark_force_node8=(
'-DPKG_CONFIG_DISABLE_NODE=ON'
'-DPKG_CONFIG_DISABLE_NODE8=OFF'
)
# Preferably don't use any options starting with:
# -Wno-<option-name>
cxx_common_opts=(
'-UENABLE_EGL_GENERIC'
'-DUSE_STD_THREADS'
'-DMESA_EGL_NO_X11_HEADERS'
'-DPXSCENE_DISABLE_WST_DECODER'
'-Wall -Werror -Wextra'
'-pipe -Werror=format-security -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches'
'-Woverloaded-virtual'
'-fPIE'
'-mmpx'
'-fno-omit-frame-pointer'
'-O2'
'-g3'
# TODO: to be removed
'-Wno-deprecated-declarations'
'-Wno-unused-parameter'
)
clang_specific_opts=(
# TODO: to be removed
'-Wno-unused-private-field'
'-Wno-ignored-attributes'
)
gcc_specific_opts=(
'-Wp,-D_FORTIFY_SOURCE=2'
# TODO: would be nice to remove below
# however, Spark is currently written in a way
# we have to keep it for a while
# e.g.: rtObjectMacros.h:190:141: warning: nonnull argument ‘r’ compared to NULL
'-Wno-nonnull-compare'
'-fno-delete-null-pointer-checks'
# TODO: tobe removed (currently those below
# still causes errors on gcc >8.1
'-Wno-cast-function-type'
'-Wno-class-memaccess'
)
gcc_asan_opts=(
'-fsanitize=address'
'-fsanitize-address-use-after-scope'
'-fsanitize-recover=address'
'-fstack-protector-all'
)
gcc_tsan_opts=(
'-fsanitize=thread'
)
# Common functions
# Compiles rtRemoteConfigGen
compile_rt_remote() {
cwd=$PWD
mkdir -p rtRemote
(cd rtRemote; cmake ../../remote && make "$@" rtRemoteConfigGen)
echo -DRTREMOTE_GENERATOR_EXPORT=$cwd/rtRemote/rtRemoteConfigGen_export.cmake
}