@@ -121,6 +121,7 @@ endmacro()
121
121
xoption (BUILD_SHARED_LIBS "Build a shared library" OFF )
122
122
if (BUILD_SHARED_LIBS )
123
123
message (STATUS "Building a shared library" )
124
+ add_definitions (-D${OPTION_NAME} )
124
125
endif ()
125
126
126
127
# note: QJS_ENABLE_TSAN is currently incompatible with the other sanitizers but we
@@ -219,6 +220,8 @@ set(qjs_sources
219
220
quickjs.c
220
221
)
221
222
223
+ add_definitions (-DQUICKJS_BUILDDLL )
224
+
222
225
if (QJS_BUILD_LIBC )
223
226
list (APPEND qjs_sources quickjs-libc.c )
224
227
endif ()
@@ -265,59 +268,6 @@ if(EMSCRIPTEN)
265
268
target_link_libraries (qjs_wasm m )
266
269
endif ()
267
270
268
-
269
- # QuickJS bytecode compiler
270
- #
271
-
272
- add_executable (qjsc
273
- qjsc.c
274
- )
275
- add_qjs_libc_if_needed (qjsc )
276
- add_static_if_needed (qjsc )
277
- target_compile_definitions (qjsc PRIVATE ${qjs_defines} )
278
- target_link_libraries (qjsc qjs )
279
-
280
-
281
- # QuickJS CLI
282
- #
283
-
284
- add_executable (qjs_exe
285
- gen/repl.c
286
- gen/standalone.c
287
- qjs.c
288
- )
289
- add_qjs_libc_if_needed (qjs_exe )
290
- add_static_if_needed (qjs_exe )
291
- set_target_properties (qjs_exe PROPERTIES
292
- OUTPUT_NAME "qjs"
293
- )
294
- target_compile_definitions (qjs_exe PRIVATE ${qjs_defines} )
295
- target_link_libraries (qjs_exe qjs )
296
- if (NOT WIN32 )
297
- set_target_properties (qjs_exe PROPERTIES ENABLE_EXPORTS TRUE )
298
- endif ()
299
- if (QJS_BUILD_CLI_WITH_MIMALLOC OR QJS_BUILD_CLI_WITH_STATIC_MIMALLOC )
300
- find_package (mimalloc REQUIRED )
301
- # Upstream mimalloc doesn't provide a way to know if both libraries are supported.
302
- if (QJS_BUILD_CLI_WITH_STATIC_MIMALLOC )
303
- target_link_libraries (qjs_exe mimalloc-static )
304
- else ()
305
- target_link_libraries (qjs_exe mimalloc )
306
- endif ()
307
- endif ()
308
-
309
- # Test262 runner
310
- #
311
-
312
- if (NOT EMSCRIPTEN )
313
- add_executable (run-test262
314
- run-test262.c
315
- )
316
- add_qjs_libc_if_needed (run-test262 )
317
- target_compile_definitions (run-test262 PRIVATE ${qjs_defines} )
318
- target_link_libraries (run-test262 qjs )
319
- endif ()
320
-
321
271
# Interrupt test
322
272
#
323
273
@@ -337,14 +287,6 @@ add_executable(unicode_gen EXCLUDE_FROM_ALL
337
287
)
338
288
target_compile_definitions (unicode_gen PRIVATE ${qjs_defines} )
339
289
340
- add_executable (function_source
341
- gen/function_source.c
342
- )
343
- add_qjs_libc_if_needed (function_source )
344
- target_include_directories (function_source PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} )
345
- target_compile_definitions (function_source PRIVATE ${qjs_defines} )
346
- target_link_libraries (function_source qjs )
347
-
348
290
# Examples
349
291
#
350
292
@@ -416,8 +358,6 @@ if(NOT IOS)
416
358
if (QJS_BUILD_LIBC )
417
359
install (FILES quickjs-libc.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} )
418
360
endif ()
419
- install (TARGETS qjs_exe RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} )
420
- install (TARGETS qjsc RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} )
421
361
install (TARGETS qjs EXPORT qjsConfig
422
362
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
423
363
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
0 commit comments