Use static libgcc and libstdc++ when doing release build

This commit is contained in:
Francesco Abbate 2020-06-02 23:20:22 +02:00
parent e01ba599ba
commit 01a4981210
3 changed files with 10 additions and 3 deletions

View File

@ -13,5 +13,11 @@ stb_truetype_dep = dependency('stb_truetype')
lite_include = include_directories('src') lite_include = include_directories('src')
install_subdir('data', install_dir : 'bin') install_subdir('data', install_dir : 'bin')
lite_cdefs = []
lite_link_args = []
if get_option('buildtype') == 'release'
lite_link_args += ['-static-libgcc', '-static-libstdc++']
endif
subdir('src') subdir('src')
subdir('tests') subdir('tests')

View File

@ -10,13 +10,14 @@ lite_sources = [
'main.c', 'main.c',
] ]
renderer_cdefs = ['-DFONT_RENDERER_HEIGHT_HACK'] lite_cdefs += ['-DFONT_RENDERER_HEIGHT_HACK']
executable('lite', executable('lite',
lite_sources, lite_sources,
include_directories: lite_include, include_directories: lite_include,
dependencies: [lua_dep, sdl_dep, libagg_dep, freetype_dep, libm, libdl], dependencies: [lua_dep, sdl_dep, libagg_dep, freetype_dep, libm, libdl],
cpp_args: renderer_cdefs, link_args: lite_link_args,
cpp_args: lite_cdefs,
install: true, install: true,
gui_app: true, gui_app: true,
) )

View File

@ -8,7 +8,7 @@ executable('stb-font-render-test',
executable('agg-font-render-test', executable('agg-font-render-test',
['../src/agg_font_freetype.cpp', '../src/font_renderer.cpp', 'agg_font_render_test.c'], ['../src/agg_font_freetype.cpp', '../src/font_renderer.cpp', 'agg_font_render_test.c'],
include_directories: lite_include, include_directories: lite_include,
cpp_args: renderer_cdefs, cpp_args: lite_cdefs,
dependencies: [sdl_dep, libagg_dep, freetype_dep, libm, libdl], dependencies: [sdl_dep, libagg_dep, freetype_dep, libm, libdl],
install: false, install: false,
) )