-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
quickjs-ng: new wrap #1865
base: master
Are you sure you want to change the base?
quickjs-ng: new wrap #1865
Changes from all commits
a74a0ef
0408f11
8bcf4ff
d503a8d
e3caeaa
e0ba7d1
2a25395
ee46a1a
bc705e6
f0c37f2
b86f398
a753bb7
7019f0c
4e6e69d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// This is a dummy file provided by meson wrapdb to avoid exposing all internal header of quickjs-ng. | ||
#include "../quickjs.h"; | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
project('quickjs-ng', 'c', version: '0.8.0', default_options: ['c_std=c11']) | ||
|
||
cc = meson.get_compiler('c') | ||
dep_m = cc.find_library('m', required: false) | ||
dep_threads = dependency('threads') | ||
deps = [dep_m, dep_threads] | ||
|
||
msvc_compat = cc.get_id() == 'msvc' or cc.get_id() == 'clang-cl' | ||
|
||
add_project_arguments( | ||
cc.get_supported_arguments( | ||
'-Wno-implicit-fallthrough', | ||
'-Wno-sign-compare', | ||
'-Wno-missing-field-initializers', | ||
'-Wno-unused-parameter', | ||
'-Wno-unused-but-set-variable', | ||
'-Wno-array-bounds', | ||
'-Wno-format-truncation', | ||
'-funsigned-char', | ||
), | ||
language: 'c', | ||
) | ||
|
||
if msvc_compat | ||
add_project_arguments( | ||
cc.get_supported_arguments( | ||
'-Wno-unsafe-buffer-usage', | ||
'-Wno-sign-conversion', | ||
'-Wno-nonportable-system-include-path', | ||
'-Wno-implicit-int-conversion', | ||
'-Wno-shorten-64-to-32', | ||
'-Wno-reserved-macro-identifier', | ||
'-Wno-reserved-identifier', | ||
'-Wdeprecated-declarations', | ||
'/experimental:c11atomics', | ||
), | ||
language: 'c', | ||
) | ||
|
||
add_project_arguments( | ||
cc.get_supported_arguments( | ||
'/wd4018', # -Wno-sign-conversion | ||
'/wd4061', # -Wno-implicit-fallthrough | ||
'/wd4100', # -Wno-unused-parameter | ||
'/wd4200', # -Wno-zero-length-array | ||
'/wd4242', # -Wno-shorten-64-to-32 | ||
'/wd4244', # -Wno-shorten-64-to-32 | ||
'/wd4245', # -Wno-sign-compare | ||
'/wd4267', # -Wno-shorten-64-to-32 | ||
'/wd4388', # -Wno-sign-compare | ||
'/wd4389', # -Wno-sign-compare | ||
'/wd4710', # Function not inlined | ||
'/wd4711', # Function was inlined | ||
'/wd4820', # Padding added after construct | ||
'/wd4996', # -Wdeprecated-declarations | ||
'/wd5045', # Compiler will insert Spectre mitigation for memory load if /Qspectre switch specified | ||
), | ||
language: 'c', | ||
) | ||
|
||
endif | ||
|
||
if get_option('buildtype') == 'debug' | ||
add_project_arguments( | ||
cc.get_supported_arguments('-ggdb', '-fno-omit-frame-pointer'), | ||
language: 'c', | ||
) | ||
endif | ||
|
||
lib_src = files( | ||
'cutils.c', | ||
'libbf.c', | ||
'libregexp.c', | ||
'libunicode.c', | ||
'quickjs-libc.c', | ||
'quickjs.c', | ||
) | ||
|
||
c_defines = ['-D_GNU_SOURCE', '-DCONFIG_BIGNUM'] | ||
|
||
if host_machine.system() == 'windows' | ||
c_defines += ['-DWIN32_LEAN_AND_MEAN', '-D_WIN32_WINNT=0x0602'] | ||
endif | ||
|
||
add_project_arguments(c_defines, language: 'c') | ||
|
||
# TODO: support shared libs | ||
quickjs_lib = static_library( | ||
'quickjs', | ||
lib_src, | ||
dependencies: deps, | ||
include_directories: include_directories('.'), | ||
) | ||
|
||
quickjs_ng_dep = declare_dependency( | ||
include_directories: include_directories('include'), | ||
link_with: quickjs_lib, | ||
dependencies: deps, | ||
) | ||
|
||
if not meson.is_subproject() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. unnecessary condition. |
||
pkg = import('pkgconfig') | ||
pkg.generate( | ||
quickjs_ng_dep, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should be pkg.generate(
- quickjs_ng_dep,
+ quickjs_lib, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. to avoid confusion with upstream quickjs: + name: 'quickjs-ng', |
||
description: 'QuickJS, the Next Generation: a mighty JavaScript engine', | ||
url: 'https://github.com/quickjs-ng/quickjs', | ||
version: meson.project_version(), | ||
) | ||
endif | ||
|
||
|
||
test('ctest', executable('ctest', 'ctest.c', dependencies: [quickjs_ng_dep],build_by_default: false)) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[wrap-file] | ||
directory = quickjs-0.8.0 | ||
source_url = https://github.com/quickjs-ng/quickjs/archive/refs/tags/v0.8.0.tar.gz | ||
source_filename = quickjs-ng-v0.8.0.tar.gz | ||
source_hash = 7e60e1e0dcd07d25664331308a2f4aee2a88d60d85896e828d25df7c3d40204e | ||
patch_directory = quickjs-ng | ||
|
||
[provide] | ||
quickjs-ng = quickjs_ng_dep | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trailing semicolon