Browse Source

Add flag for helping to build macOS universal binaries

Signed-off-by: falkTX <falktx@falktx.com>
roth-air
falkTX 2 years ago
parent
commit
457678c455
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
2 changed files with 30 additions and 8 deletions
  1. +24
    -8
      meson.build
  2. +6
    -0
      meson_options.txt

+ 24
- 8
meson.build View File

@@ -23,6 +23,7 @@ build_vst3 = get_option('build-vst3')
build_juce5_only = get_option('build-juce5-only')
build_juce6_only = get_option('build-juce6-only')
build_juce7_only = get_option('build-juce7-only')
build_universal = get_option('build-universal')
linux_embed = get_option('linux-embed')
optimizations = get_option('optimizations') and buildtype != 'debug'

@@ -188,10 +189,15 @@ if optimizations
'-fprefetch-loop-arrays',
]
endif
if host_machine.cpu_family().contains('x86')
if host_machine.cpu_family().contains('x86') or build_universal
build_flags_release += [
'-mtune=generic', '-msse', '-msse2', '-mfpmath=sse',
'-mtune=generic', '-msse', '-msse2',
]
if not build_universal
build_flags_release += [
'-mfpmath=sse',
]
endif
endif
endif

@@ -206,6 +212,12 @@ if os_darwin
build_flags_cpp += [
'-ObjC++',
]
if universal
build_flags += [
'-arch', 'x86_64',
'-arch', 'arm64',
]
endif
elif os_windows
build_flags += [
'-DWINDOWS=1',
@@ -249,16 +261,20 @@ if optimizations
]
endif

if os_windows
link_flags += [
'-static',
]
endif

if os_darwin
if universal
link_flags += [
'-arch', 'x86_64',
'-arch', 'arm64',
]
endif
link_flags_release += [
'-Wl,-dead_strip,-dead_strip_dylibs,-x',
]
elif os_windows
link_flags += [
'-static',
]
else
link_flags += [
'-Wl,--as-needed,--no-undefined',


+ 6
- 0
meson_options.txt View File

@@ -46,6 +46,12 @@ option('build-juce7-only',
description: 'Build only juce7 libraries and plugins',
)

option('build-universal',
type: 'boolean',
value: false,
description: 'Build macOS universal binaries',
)

option('plugins',
type : 'array',
description: 'Plugins to build',


Loading…
Cancel
Save