Skip to content

Commit

Permalink
update extconf to sync with Makefile of quickjs
Browse files Browse the repository at this point in the history
  • Loading branch information
hmsk committed Jan 17, 2025
1 parent b670c15 commit fddb90f
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions ext/quickjsrb/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,34 @@

append_cflags('-I$(srcdir)/quickjs')

append_cflags('-fwrapv')

append_cflags('-g')
append_cflags('-O2')
append_cflags('-Wall')
append_cflags('-MMD')
append_cflags('-MF')
append_cflags('-Wextra')
append_cflags('-Wno-sign-compare')
append_cflags('-Wno-missing-field-initializers')
append_cflags('-Wundef -Wuninitialized')
append_cflags('-Wunused -Wno-unused-parameter')
append_cflags('-Wwrite-strings')
append_cflags('-Wchar-subscripts -funsigned-char')
append_cflags('-D_GNU_SOURCE -DCONFIG_VERSION=\"2024-02-14\" -DCONFIG_BIGNUM')

case CONFIG['arch']
when /darwin/
append_cflags('-Wextra')
append_cflags('-Wno-sign-compare')
append_cflags('-Wno-missing-field-initializers')
append_cflags('-Wundef -Wuninitialized')
append_cflags('-Wunused -Wno-unused-parameter')
append_cflags('-Wwrite-strings')
append_cflags('-Wchar-subscripts -funsigned-char')
else
append_cflags('-Wno-array-bounds -Wno-format-truncation')
end

append_cflags('-fwrapv')
#$defs.push('-D_GNU_SOURCE -DCONFIG_VERSION=\"2024-02-14\"')
#$defs.push('-DCONFIG_BIGNUM')
$CFLAGS << ' ' << '-D_GNU_SOURCE -DCONFIG_VERSION=\"2024-02-14\" -DCONFIG_BIGNUM'

abort('could not find quickjs.h') unless find_header('quickjs.h')
abort('could not find cutils.h') unless find_header('cutils.h')
abort('could not find quickjs-libc.h') unless find_header('quickjs-libc.h')
#abort('could not find libbf.h') unless find_header('libbf.h')

# Makes all symbols private by default to avoid unintended conflict
# with other gems. To explicitly export symbols you can use RUBY_FUNC_EXPORTED
Expand Down

0 comments on commit fddb90f

Please sign in to comment.