2018-05-15 02:27:25 +02:00
|
|
|
|
2019-02-08 19:59:36 +01:00
|
|
|
util_deps = []
|
|
|
|
|
2018-05-15 02:27:25 +02:00
|
|
|
util_src = files(
|
|
|
|
'assert.c',
|
|
|
|
'crap.c',
|
|
|
|
'env.c',
|
2019-08-25 01:28:46 +02:00
|
|
|
'fbmgr.c',
|
2018-07-04 10:36:16 +02:00
|
|
|
'fbpair.c',
|
2019-08-25 01:28:46 +02:00
|
|
|
'fbutil.c',
|
2018-05-15 02:27:25 +02:00
|
|
|
'geometry.c',
|
|
|
|
'graphics.c',
|
|
|
|
'io.c',
|
|
|
|
'kvparser.c',
|
|
|
|
'miscmath.c',
|
|
|
|
'pngcruft.c',
|
2018-06-29 23:36:51 +02:00
|
|
|
'rectpack.c',
|
2020-08-15 13:51:12 +02:00
|
|
|
'strbuf.c',
|
2018-05-15 02:27:25 +02:00
|
|
|
'stringops.c',
|
|
|
|
)
|
|
|
|
|
2019-01-25 01:02:56 +01:00
|
|
|
if is_developer_build
|
2018-05-15 02:27:25 +02:00
|
|
|
util_src += files('debug.c')
|
|
|
|
endif
|
|
|
|
|
2019-02-08 20:12:52 +01:00
|
|
|
config.set('TAISEI_BUILDCONF_USE_DESIGNATED_INIT', cc.compiles(
|
|
|
|
'struct { int dummy; } __attribute__((designated_init)) x;',
|
|
|
|
name : '__attribute__((designated_init)) with -Werror',
|
|
|
|
args : ['-Wattributes', '-Werror']
|
|
|
|
))
|
Some compatibility fixes for Elbrus compiler (and others based on EDG front end) (#157)
* Reduce alignment to 16 due to stack variables alignment
On some archs (e.g. elbrus) there is no possibility to align
variables on stack by more that 16 bytes.
* Added check for -Wno-typedef-redefinition
In C11, there is legal to redefine typedef with the same type,
but some compilers like elbrus's lcc and, probably, intel's icc
generate a warning about that. So we disable it.
* Typo fix
* Fix __builtin_unreachable() warning on some frontends like EDG
* Added check for __attribute__((designated_init))
It doesn't work for elbrus'c lcc and clang; but clang does not
generate warning by default, but we still disable it just in case.
* A hack to avoid -Wtype-limits for compilers with unsigned enums
* Rewritten unreachable __builtin_unreachable() behavior.
According to https://bugs.llvm.org/show_bug.cgi?id=13910,
old clang versions also suffer from this issue along with lcc.
And also this warning option is removed from gcc since 4.5.0,
and it's likely there is no unreachable code analysis at all:
https://gcc.gnu.org/onlinedocs/gcc-4.5.0/gcc/Warning-Options.html
* Fixed unneeded stray UNREACHABLE which caused warnings
* Removed alignas() which is unneeded after lowering alignment requirements
* Removed a hack of -Wunreachable-code disabling on certain compilers
Actually, there was a wrong opinion that most of unreachable code
warnings are produced by __builtin_unreachable() itself,
not the certain use of it. After commit 36493d3, it is finally
figured out that it wasn't the case.
* Added dummy element to a struct in a test for designated_init
This test will enexpectedly fail when GNU extensions are not available
2019-02-07 09:11:13 +01:00
|
|
|
|
2019-02-08 19:59:36 +01:00
|
|
|
use_libcrypto = get_option('use_libcrypto')
|
|
|
|
|
|
|
|
if use_libcrypto == 'auto'
|
|
|
|
use_libcrypto = dep_crypto.found()
|
|
|
|
else
|
|
|
|
use_libcrypto = (use_libcrypto == 'true')
|
|
|
|
endif
|
|
|
|
|
|
|
|
if use_libcrypto
|
|
|
|
assert(dep_crypto.found(), 'use_libcrypto forced but libcrypto not found. Install OpenSSL or disable use_libcrypto.')
|
|
|
|
util_src += files('sha256_openssl.c')
|
|
|
|
util_deps += [dep_crypto]
|
|
|
|
else
|
2019-03-12 00:56:30 +01:00
|
|
|
util_src += files('sha256.c')
|
2019-02-08 19:59:36 +01:00
|
|
|
endif
|
|
|
|
|
2018-05-15 02:27:25 +02:00
|
|
|
if host_machine.system() == 'windows'
|
2018-05-28 10:10:41 +02:00
|
|
|
# NOTE: Even if we ever build this with something like Midipix, we'd
|
|
|
|
# probably still want to use the winapi implementation of this here.
|
|
|
|
util_src += files('platform_win32.c')
|
|
|
|
else
|
|
|
|
# No have_posix check, it might just work.
|
|
|
|
util_src += files('platform_posix.c')
|
2018-05-15 02:27:25 +02:00
|
|
|
endif
|
2020-11-19 00:12:51 +01:00
|
|
|
|
|
|
|
if dep_gamemode.found()
|
|
|
|
util_src += files('gamemode.c')
|
|
|
|
else
|
|
|
|
util_src += files('gamemode_stub.c')
|
|
|
|
endif
|