Add 'use_gnu_ext' option

Controls the USE_GNU_EXTENSIONS define in compat.h
This commit is contained in:
Andrei Alexeyev 2020-03-31 22:51:31 +03:00
parent b902e90229
commit 40a604a6a5
No known key found for this signature in database
GPG key ID: 363707CD4C7FE8A4
3 changed files with 12 additions and 1 deletions

View file

@ -271,6 +271,8 @@ else
config.set('TAISEI_BUILDCONF_HAVE_MAX_ALIGN_T', malloc_alignment > 0)
endif
config.set('TAISEI_BUILDCONF_USE_GNU_EXTENSIONS', get_option('use_gnu_ext'))
prefer_relpath_systems = [
'windows',
]

View file

@ -190,3 +190,10 @@ option(
value : false,
description : 'Build shaderc and spirv-cross CLI tools from subprojects even if system versions exist'
)
option(
'use_gnu_ext',
type : 'boolean',
value : true,
description : 'Allow use of some GNU C extensions (if supported by compiler)'
)

View file

@ -81,7 +81,9 @@
#define DIAGNOSTIC_GCC(x)
#define DIAGNOSTIC_CLANG(x)
#else
#define USE_GNU_EXTENSIONS
#ifdef TAISEI_BUILDCONF_USE_GNU_EXTENSIONS
#define USE_GNU_EXTENSIONS
#endif
#define UNREACHABLE __builtin_unreachable()
#define DIAGNOSTIC(x) PRAGMA(GCC diagnostic x)