Skip to content

Commit

Permalink
Fix linux armhf and macos build
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <[email protected]>
  • Loading branch information
falkTX committed Dec 9, 2023
1 parent 054e5c5 commit 4b71709
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
11 changes: 10 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ build_juce7_only = get_option('build-juce7-only')
build_universal = get_option('build-universal')
optimizations = get_option('optimizations') and buildtype != 'debug'
lto_optimizations = get_option('lto-optimizations') and buildtype != 'debug' and not os_windows
neon_optimizations = get_option('neon-optimizations') and buildtype != 'debug' and (
host_machine.cpu_family() == 'arm'
)
sse_optimizations = get_option('sse-optimizations') and buildtype != 'debug' and (
host_machine.cpu_family() == 'x86' or host_machine.cpu_family() == 'x86_64'
)
Expand Down Expand Up @@ -183,7 +186,7 @@ build_flags_release_cpp = [
'-fvisibility-inlines-hidden',
]

if optimizations or sse_optimizations
if optimizations or neon_optimizations or sse_optimizations
build_flags_release += [
'-ffast-math',
]
Expand Down Expand Up @@ -217,6 +220,12 @@ if sse_optimizations or build_universal
endif
endif

if neon_optimizations
build_flags_release += [
'-mfpu=neon-vfpv4', '-mfloat-abi=hard',
]
endif

###############################################################################
# build flags (per-OS macros and setup)

Expand Down
6 changes: 6 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ option('lto-optimizations',
description: 'Enable LTO optimizations',
)

option('neon-optimizations',
type: 'boolean',
value: true,
description: 'Enable NEON optimizations',
)

option('sse-optimizations',
type: 'boolean',
value: true,
Expand Down
3 changes: 3 additions & 0 deletions scripts/generate-ttl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ lib="${3}"
# do a whole dance to try to replicate expected behaviour
if [ -z "${MESON_EXE_WRAPPER}" ]; then
fileout="$(file "${gen}")"
if echo "${fileout}" | grep -q "Mach-O"; then
MESON_EXE_WRAPPER=""

if echo "${fileout}" | grep -q "PE32 executable.*Intel 80386"; then
MESON_EXE_WRAPPER="wine"

Expand Down

0 comments on commit 4b71709

Please sign in to comment.