Add 'use_gnu_ext' option
Controls the USE_GNU_EXTENSIONS define in compat.h
This commit is contained in:
parent
b902e90229
commit
40a604a6a5
3 changed files with 12 additions and 1 deletions
|
@ -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',
|
||||
]
|
||||
|
|
|
@ -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)'
|
||||
)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue