File tree 2 files changed +64
-5
lines changed
2 files changed +64
-5
lines changed Original file line number Diff line number Diff line change 48
48
if : ${{ matrix.buildType == 'Release' }}
49
49
run : |
50
50
time ./build/run-test262 -m -c test262.conf -a
51
+ linux-shared :
52
+ runs-on : ubuntu-latest
53
+ steps :
54
+ - uses : actions/checkout@v3
55
+ - name : build
56
+ run : |
57
+ mkdir build
58
+ cd build
59
+ cmake -DBUILD_SHARED_LIBS=ON ..
60
+ cd ..
61
+ cmake --build build -j$(getconf _NPROCESSORS_ONLN)
62
+ ldd build/qjs
63
+ - name : stats
64
+ run : |
65
+ ./build/qjs -qd
51
66
linux-asan :
52
67
runs-on : ubuntu-latest
53
68
steps :
@@ -160,6 +175,21 @@ jobs:
160
175
./build/qjs tests/test_loop.js
161
176
./build/qjs tests/test_std.js
162
177
./build/qjs tests/test_worker.js
178
+ macos-shared :
179
+ runs-on : macos-latest
180
+ steps :
181
+ - uses : actions/checkout@v3
182
+ - name : build
183
+ run : |
184
+ mkdir build
185
+ cd build
186
+ cmake -DBUILD_SHARED_LIBS=ON ..
187
+ cd ..
188
+ cmake --build build -j$(getconf _NPROCESSORS_ONLN)
189
+ otool -L build/qjs
190
+ - name : stats
191
+ run : |
192
+ ./build/qjs -qd
163
193
macos-asan :
164
194
runs-on : macos-latest
165
195
steps :
@@ -248,3 +278,31 @@ jobs:
248
278
./build/qjs tests/test_builtin.js
249
279
./build/qjs tests/test_loop.js
250
280
./build/qjs tests/test_std.js
281
+ windows-mingw-shared :
282
+ runs-on : windows-latest
283
+ defaults :
284
+ run :
285
+ shell : msys2 {0}
286
+ steps :
287
+ - uses : actions/checkout@v3
288
+ - name : Setup MSYS2
289
+ uses : msys2/setup-msys2@v2
290
+ with :
291
+ install : >-
292
+ git
293
+ make
294
+ pacboy : >-
295
+ cmake:p
296
+ ninja:p
297
+ toolchain:p
298
+ - name : build
299
+ run : |
300
+ mkdir build
301
+ cd build
302
+ cmake -DBUILD_SHARED_LIBS=ON ..
303
+ cd ..
304
+ cmake --build build -j$(getconf _NPROCESSORS_ONLN)
305
+ ldd build/qjs
306
+ - name : stats
307
+ run : |
308
+ ./build/qjs -qd
Original file line number Diff line number Diff line change @@ -3,10 +3,8 @@ cmake_minimum_required(VERSION 3.9)
3
3
project (quickjs LANGUAGES C)
4
4
5
5
# TODO:
6
- # - LTO
7
6
# - Support cross-compilation
8
7
# - Install targets
9
- # - Shared library target
10
8
11
9
set (CMAKE_C_STANDARD_REQUIRED ON )
12
10
set (CMAKE_C_EXTENSIONS ON )
@@ -52,6 +50,11 @@ else()
52
50
add_compile_options (-g)
53
51
endif ()
54
52
53
+ option (BUILD_SHARED_LIBS "Build a shared library" OFF )
54
+ if (BUILD_SHARED_LIBS )
55
+ message (STATUS "Building a shared library" )
56
+ endif ()
57
+
55
58
option (CONFIG_ASAN "Enable AddressSanitizer (ASan)" OFF )
56
59
option (CONFIG_MSAN "Enable MemorySanitizer (MSan)" OFF )
57
60
option (CONFIG_UBSAN "Enable UndefinedBehaviorSanitizer (UBSan)" OFF )
@@ -97,8 +100,6 @@ add_link_options(
97
100
)
98
101
endif ()
99
102
100
- set (CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "ON" )
101
-
102
103
103
104
# QuickJS library
104
105
#
@@ -113,7 +114,7 @@ set(qjs_sources
113
114
114
115
list (APPEND qjs_defines _GNU_SOURCE)
115
116
116
- add_library (qjs STATIC ${qjs_sources} )
117
+ add_library (qjs ${qjs_sources} )
117
118
target_compile_definitions (qjs PRIVATE ${qjs_defines} )
118
119
if (CMAKE_BUILD_TYPE MATCHES Debug)
119
120
target_compile_definitions (qjs PRIVATE
You can’t perform that action at this time.
0 commit comments