diff options
author | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2018-11-07 18:01:48 +0000 |
---|---|---|
committer | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2018-11-09 11:43:59 +0000 |
commit | c1ad0879a195f3056abde938ac81c7f4677b676b (patch) | |
tree | 775f7551765defd7f8c7ad598f43e8c2057a3d81 /meson.build | |
parent | a447bbd489ba63a77feaeca49217431705aed2ec (diff) | |
download | efl-c1ad0879a195f3056abde938ac81c7f4677b676b.tar.gz |
meson - add checks/options for mmx, sse3, neon, altivec
so we can build our assembly fast-paths again.... - also clean up the
code a bit to match...
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 58 |
1 files changed, 56 insertions, 2 deletions
diff --git a/meson.build b/meson.build index dcef2ea66d..a89b899112 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project('efl', ['c','cpp'], version: '1.21.99', default_options : ['buildtype=plain'], - meson_version : '>=0.46' + meson_version : '>=0.47' ) if target_machine.system() == 'darwin' @@ -110,6 +110,59 @@ if compiler.compiles(code, args : '-lc', name : 'environ check') == true config_h.set10('HAVE_ENVIRON', true) endif +## or should this be target_machine? +cpu_mmx = false +cpu_sse3 = false +cpu_neon = false +cpu_neon_intrinsics = false +cpu_altivec = false +evas_opt_c_args = [ ] +machine_c_args = [ ] +compiler = meson.get_compiler('c') +if host_machine.cpu_family() == 'x86' or host_machine.cpu_family() == 'x86_64' + if compiler.check_header('immintrin.h') == true + if (get_option('cpu-mmx') == true) + config_h.set10('BUILD_MMX', true) + cpu_mmx = true + message('x86 build - MMX enabled') + if (get_option('cpu-sse3') == true) + config_h.set10('BUILD_SSE3', true) + evas_opt_c_args += [ '-msse3' ] + cpu_sse3 = true + message('x86 build - SSE3 enabled') + endif + endif + endif +elif host_machine.cpu_family() == 'arm' + if compiler.check_header('arm_neon.h') == true + if (get_option('cpu-neon') == true) + config_h.set10('BUILD_NEON', true) + machine_c_args += ['-mfpu=neon', '-ftree-vectorize'] + cpu_neon = true + message('ARM build - NEON enabled') + endif + endif +elif host_machine.cpu_family() == 'aarch64' + if compiler.check_header('arm_neon.h') == true + if (get_option('cpu-neon') == true) + config_h.set10('BUILD_NEON', true) + config_h.set10('BUILD_NEON_INTRINSICS', true) + machine_c_args += ['-ftree-vectorize'] + cpu_neon = true + cpu_neon_intrinsics = true + message('ARM64 build - NEON + intrinsics enabled') + endif + endif +elif host_machine.cpu_family() == 'ppc' or host_machine.cpu_family() == 'ppc64' + if compiler.check_header('altivec.h') == true + if (get_option('cpu-akltivec') == true) + config_h.set10('BUILD_ALTIVEC', true) + machine_c_args += [ '-maltivec' ] + cpu_altivec = true + message('PPC/POWER build - ALTIVEC enabled') + endif + endif +endif config_dir = [include_directories('.')] eolian_include_directories = [] @@ -231,7 +284,8 @@ foreach package : subprojects package_version_name = '-'.join(package_name.split('_')) + '-' + version_major package_c_args = [ '-DPACKAGE_DATA_DIR="'+ join_paths(dir_data, package_name)+'"', - '-DNEED_RUN_IN_TREE=1' + '-DNEED_RUN_IN_TREE=1', + machine_c_args ] automatic_pkgfile = true if package[1].length() == 0 or get_option(package[1][0]) |