segatools/meson.build
888be1df7c6f962725a28a172a5394eec3e228e7 5a57a409a1 build: enable "secure" CRT headers on MinGW
Some distributions of MinGW, recent builds included, require
`MINGW_HAS_SECURE_API` to be defined in order to expose `_s` variants of
functions, as defined by Annex K of the C standard, in the headers.

Omitting this definition leads to a bunch of compiler warnings clobbering
the build output, as well as possibly incorrect inference of argument and
return types by the compiler.

It needs to be set to `1` as opposed to simply defined as per
https://sourceforge.net/p/mingw-w64/bugs/714/.
2019-12-22 21:55:55 +01:00

55 lines
1.1 KiB
Meson

project('segatools', 'c', version: '0.1.0')
add_project_arguments(
'-DCOBJMACROS',
'-DDIRECTINPUT_VERSION=0x0800',
'-DWIN32_LEAN_AND_MEAN',
'-D_WIN32_WINNT=_WIN32_WINNT_WIN7',
'-DMINGW_HAS_SECURE_API=1',
language: 'c',
)
# Use get_argument_syntax() instead once Meson 0.49.0 releases
if meson.get_compiler('c').get_id() != 'msvc'
add_project_arguments(
'-ffunction-sections',
'-fdata-sections',
language: 'c',
)
add_project_link_arguments(
'-Wl,--exclude-all-symbols',
'-Wl,--gc-sections',
'-static-libgcc',
language: 'c',
)
endif
cc = meson.get_compiler('c')
dinput8_lib = cc.find_library('dinput8')
dxguid_lib = cc.find_library('dxguid')
xinput_lib = cc.find_library('xinput')
inc = include_directories('.')
capnhook = subproject('capnhook')
subdir('amex')
subdir('iccard')
subdir('board')
subdir('hooklib')
subdir('jvs')
subdir('platform')
subdir('util')
subdir('aimeio')
subdir('chuniio')
subdir('divaio')
subdir('idzio')
subdir('mu3io')
subdir('chunihook')
subdir('divahook')
subdir('idzhook')
subdir('minihook')
subdir('mu3hook')