Skip to content

Commit

Permalink
meson: Add missing deps and enable GNU extensions (bellard#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
oleavr authored Dec 15, 2021
2 parents 923440e + bd76cf5 commit 0eaa541
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ cc = meson.get_compiler('c')
have_msvc = cc.get_id() == 'msvc'
have_emscripten = cc.get_define('EMSCRIPTEN') != ''

threads_dep = dependency('threads')
dl_dep = cc.find_library('dl', required: false)
m_dep = cc.find_library('m', required: false)

headers = [
Expand Down Expand Up @@ -65,10 +67,14 @@ configure_file(
output: 'config.h',
configuration: cdata,
)
add_project_arguments(have_msvc ? '/FI' : '-include', 'config.h', language: 'c')
add_project_arguments(
have_msvc ? '/FI' : '-include', meson.current_build_dir() / 'config.h',
'-D_GNU_SOURCE=1',
language: 'c',
)

quickjs = library('quickjs', sources,
dependencies: m_dep,
dependencies: [threads_dep, dl_dep, m_dep],
install: true,
)
quickjs_dep = declare_dependency(
Expand Down

0 comments on commit 0eaa541

Please sign in to comment.