11project (' quickjs-ng' , ' c' ,
2- version : ' v0.6.1 ' ,
2+ version : ' v0.8.0 ' ,
33 default_options : [
44 ' buildtype=release' ,
55 ' b_vscrt=from_buildtype' ,
@@ -11,13 +11,10 @@ project('quickjs-ng', 'c',
1111cc = meson .get_compiler(' c' )
1212
1313threads_dep = dependency (' threads' )
14+ atomic_dep = cc.find_library (' atomic' , required : false )
1415dl_dep = cc.find_library (' dl' , required : false )
1516m_dep = cc.find_library (' m' , required : false )
1617
17- headers = [
18- ' quickjs.h' ,
19- ]
20-
2118sources = [
2219 ' cutils.c' ,
2320 ' libbf.c' ,
@@ -28,6 +25,7 @@ sources = [
2825
2926compiler_flags = [
3027 ' -fvisibility=hidden' ,
28+ ' -fvisibility-inlines-hidden' ,
3129 ' -Wno-implicit-fallthrough' ,
3230 ' -Wno-sign-compare' ,
3331 ' -Wno-missing-field-initializers' ,
@@ -40,59 +38,51 @@ compiler_flags = [
4038]
4139
4240if cc.get_id() == ' msvc'
43- compiler_flags += ' -Wno-unsafe-buffer-usage'
44- compiler_flags += ' -Wno-sign-conversion'
45- compiler_flags += ' -Wno-nonportable-system-include-path'
46- compiler_flags += ' -Wno-implicit-int-conversion'
47- compiler_flags += ' -Wno-shorten-64-to-32'
48- compiler_flags += ' -Wno-reserved-macro-identifier'
49- compiler_flags += ' -Wno-reserved-identifier'
50- compiler_flags += ' -Wdeprecated-declarations'
51- compiler_flags += ' /experimental:c11atomics'
52- compiler_flags += ' /wd4018' # -Wno-sign-conversion
53- compiler_flags += ' /wd4061' # -Wno-implicit-fallthrough
54- compiler_flags += ' /wd4100' # -Wno-unused-parameter
55- compiler_flags += ' /wd4200' # -Wno-zero-length-array
56- compiler_flags += ' /wd4242' # -Wno-shorten-64-to-32
57- compiler_flags += ' /wd4244' # -Wno-shorten-64-to-32
58- compiler_flags += ' /wd4245' # -Wno-sign-compare
59- compiler_flags += ' /wd4267' # -Wno-shorten-64-to-32
60- compiler_flags += ' /wd4388' # -Wno-sign-compare
61- compiler_flags += ' /wd4389' # -Wno-sign-compare
62- compiler_flags += ' /wd4710' # Function not inlined
63- compiler_flags += ' /wd4711' # Function was inlined
64- compiler_flags += ' /wd4820' # Padding added after construct
65- compiler_flags += ' /wd4996' # -Wdeprecated-declarations
66- compiler_flags += ' /wd5045' # Compiler will insert Spectre mitigation for memory load if /Qspectre switch specified
41+ compiler_flags += ' -Wno-unsafe-buffer-usage'
42+ compiler_flags += ' -Wno-sign-conversion'
43+ compiler_flags += ' -Wno-nonportable-system-include-path'
44+ compiler_flags += ' -Wno-implicit-int-conversion'
45+ compiler_flags += ' -Wno-shorten-64-to-32'
46+ compiler_flags += ' -Wno-reserved-macro-identifier'
47+ compiler_flags += ' -Wno-reserved-identifier'
48+ compiler_flags += ' -Wdeprecated-declarations'
49+ compiler_flags += ' /experimental:c11atomics'
50+ compiler_flags += ' /wd4018' # -Wno-sign-conversion
51+ compiler_flags += ' /wd4061' # -Wno-implicit-fallthrough
52+ compiler_flags += ' /wd4100' # -Wno-unused-parameter
53+ compiler_flags += ' /wd4200' # -Wno-zero-length-array
54+ compiler_flags += ' /wd4242' # -Wno-shorten-64-to-32
55+ compiler_flags += ' /wd4244' # -Wno-shorten-64-to-32
56+ compiler_flags += ' /wd4245' # -Wno-sign-compare
57+ compiler_flags += ' /wd4267' # -Wno-shorten-64-to-32
58+ compiler_flags += ' /wd4388' # -Wno-sign-compare
59+ compiler_flags += ' /wd4389' # -Wno-sign-compare
60+ compiler_flags += ' /wd4710' # Function not inlined
61+ compiler_flags += ' /wd4711' # Function was inlined
62+ compiler_flags += ' /wd4820' # Padding added after construct
63+ compiler_flags += ' /wd4996' # -Wdeprecated-declarations
64+ compiler_flags += ' /wd5045' # Compiler will insert Spectre mitigation for memory load if /Qspectre switch specified
6765endif
6866
6967# required on linux, but ignored by windows
70- add_project_arguments ( ' -D_GNU_SOURCE=1' , language : ' c ' )
68+ quickjs_c_args = [ ' -D_GNU_SOURCE=1' ]
7169
7270foreach flag : compiler_flags
7371 if cc.has_argument(flag)
74- add_project_arguments (flag, language : ' c ' )
72+ quickjs_c_args += flag
7573 endif
7674endforeach
7775
7876quickjs = static_library (' quickjs' , sources,
79- dependencies : [threads_dep, dl_dep, m_dep],
77+ dependencies : [atomic_dep, threads_dep, dl_dep, m_dep],
78+ c_args : quickjs_c_args,
79+ pic : true ,
80+ gnu_symbol_visibility : ' hidden' ,
8081 implicit_include_directories : false ,
81- install : false ,
82+ install : false
8283)
8384
8485quickjs_dep = declare_dependency (
8586 link_with : quickjs,
8687 include_directories : include_directories (' .' ),
8788)
88-
89- qjsc_sources = [
90- ' qjsc.c' ,
91- ]
92-
93- qjsc = executable (' qjsc' , qjsc_sources,
94- dependencies : quickjs_dep,
95- include_directories : include_directories (' .' ),
96- implicit_include_directories : false ,
97- install : false ,
98- )
0 commit comments