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)
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 @@
1if get_option('native-arch-optimization')
2 if target_machine.cpu_family() == 'x86' or target_machine.cpu_family() == 'x86_64'
3 native_header = 'immintrin.h'
4 elif target_machine.cpu_family() == 'arm'
5 native_header = 'arm_neon.h'
6 elif target_machine.cpu_family() == 'aarch64'
7 native_header = 'arm_neon.h'
8 elif target_machine.cpu_family() == 'ppc' or target_machine.cpu_family() == 'ppc64'
9 native_header = 'altivec.h'
10 endif
11
12 if cc.has_header(native_header) == false
13 error('Error, header '+native_header+' is required')
14 endif
15endif
16
1header_checks = [ 17header_checks = [
2 'alloca.h', 18 'alloca.h',
3 'asm/hwcap.h', 19 'asm/hwcap.h',