From da2c747f3eb85a1cb59504a4f9090e5c1e52745a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Guzm=C3=A1n?= Date: Sat, 1 Apr 2023 13:53:26 -0600 Subject: [PATCH] give warning if stack protection is not supported --- meson.build | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 10240e4..704e77f 100644 --- a/meson.build +++ b/meson.build @@ -148,8 +148,14 @@ if get_option('SQLITECPP_USE_STACK_PROTECTION') message('warning: SQLiteCpp does not support stack protection on MinGW-W64') message('warning: this could lead to a crash on the application') message('warning: you can disable this warning by setting SQLITECPP_USE_STACK_PROTECTOR to false') - else + ## check if it is supported by the compiler + elif cxx.has_argument('-fstack-protector') sqlitecpp_args += ['-fstack-protector'] + ## if not supported give a warning + else + message('warning: SQLiteCpp does not have stack protection support in this compiler') + message('warning: this argument will be ignored') + message('warning: you can disable this warning by setting SQLITECPP_USE_STACK_PROTECTOR to false') endif endif