summaryrefslogtreecommitdiff
path: root/header_checks
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2018-11-16 16:49:53 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2018-11-16 17:29:05 +0100
commit46422187d81145f87b5f2ec023aaea4554999f74 (patch)
tree628de080ef4173d3d2c616663d734091bef53230 /header_checks
parentae543adbd1cddfc6fbadb564c3be46c71beb6e5f (diff)
downloadefl-46422187d81145f87b5f2ec023aaea4554999f74.tar.gz
meson: cleanup the native-cpu optimization build code
you were not able to disable the header checks, so if the header was not there it indicated that you could turn it of. However, the option check was in the has_header if not outside of it. Further more, header checks are done in the subdirectory that is done for header checks, unneccessary cpu_**** flags are removed, global optimization options are added to the global_arguments instead of just the package_c_args, which leads to the fact that also all binaries etc. are build by default with those optimization flags. This also reduces the amount of options to a minimum of 1 option, to just control if there should be the optimization or not. This also changes from host_maschine to target_mschine, since we probebly want to enable the optimization for the target maschine, not the host. Differential Revision: https://phab.enlightenment.org/D7296
Diffstat (limited to 'header_checks')
-rw-r--r--header_checks/meson.build16
1 files changed, 16 insertions, 0 deletions
diff --git a/header_checks/meson.build b/header_checks/meson.build
index 01e557e95f..cb47b040d4 100644
--- a/header_checks/meson.build
+++ b/header_checks/meson.build
@@ -1,3 +1,19 @@
+if get_option('native-arch-optimization')
+ if target_machine.cpu_family() == 'x86' or target_machine.cpu_family() == 'x86_64'
+ native_header = 'immintrin.h'
+ elif target_machine.cpu_family() == 'arm'
+ native_header = 'arm_neon.h'
+ elif target_machine.cpu_family() == 'aarch64'
+ native_header = 'arm_neon.h'
+ elif target_machine.cpu_family() == 'ppc' or target_machine.cpu_family() == 'ppc64'
+ native_header = 'altivec.h'
+ endif
+
+ if cc.has_header(native_header) == false
+ error('Error, header '+native_header+' is required')
+ endif
+endif
+
header_checks = [
'alloca.h',
'asm/hwcap.h',