From 0e2ded463e4b9ea995e0c4a947d461cbf636e39c Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Fri, 11 Oct 2019 17:29:41 +0300 Subject: Add some cpp compiler options and warnings --- meson.build | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'meson.build') diff --git a/meson.build b/meson.build index 4a06b1d..5798c49 100644 --- a/meson.build +++ b/meson.build @@ -10,6 +10,20 @@ if not get_option('debug') add_project_arguments('-DQT_NO_DEBUG', language: 'cpp') endif +cxx = meson.get_compiler('cpp') + +# add some specific flags +add_project_arguments(cxx.get_supported_arguments([ + '-ffunction-sections', # Place each function into its own section + # Leads to better ASLR but larger executables + '-fstack-protector-all', # Emit code to check for buffer overflows on all functions + '-fstack-clash-protection', # Emit code to check for stack clash attacks + + '-mspeculative-load-hardening', # Spectre v1 mitigation + + '-Wimplicit-fallthrough', +]), language: 'cpp') + mod_qt5 = import('qt5') dep_qt5 = dependency('qt5', modules: ['Core', 'Network', 'Widgets', 'WebEngineWidgets', 'Concurrent']) -- cgit v1.2.1