Browse Source

Split optimizations into different options

Signed-off-by: falkTX <falktx@falktx.com>
pull/117/head
falkTX 1 year ago
parent
commit
df21b91729
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
5 changed files with 96 additions and 117 deletions
  1. +59
    -59
      .github/workflows/build.yml
  2. +24
    -13
      meson.build
  3. +13
    -1
      meson_options.txt
  4. +0
    -22
      ports-juce5/meson.build
  5. +0
    -22
      ports-juce6/meson.build

+ 59
- 59
.github/workflows/build.yml View File

@@ -15,13 +15,13 @@ jobs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up cache
id: cache
uses: actions/cache@v2
with:
path: |
build
key: linux-arm64-v${{ env.CACHE_VERSION }}
#- name: Set up cache
#id: cache
#uses: actions/cache@v2
#with:
#path: |
#build
#key: linux-arm64-v${{ env.CACHE_VERSION }}
- name: Fix GitHub's mess
run: |
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
@@ -48,7 +48,7 @@ jobs:
LDFLAGS: -static-libgcc -static-libstdc++
PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig
run: |
meson build --buildtype=release --prefix=/usr
meson build --buildtype=release --prefix=/usr -Dsse-optimizations=false
ninja -C build
- name: Install linux armhf
run: |
@@ -86,13 +86,13 @@ jobs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up cache
id: cache
uses: actions/cache@v2
with:
path: |
build
key: linux-armhf-v${{ env.CACHE_VERSION }}
#- name: Set up cache
#id: cache
#uses: actions/cache@v2
#with:
#path: |
#build
#key: linux-armhf-v${{ env.CACHE_VERSION }}
- name: Fix GitHub's mess
run: |
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
@@ -121,7 +121,7 @@ jobs:
LDFLAGS: -static-libgcc -static-libstdc++
PKG_CONFIG_PATH: /usr/lib/arm-linux-gnueabihf/pkgconfig
run: |
meson build --buildtype=release --prefix=/usr
meson build --buildtype=release --prefix=/usr -Dsse-optimizations=false
ninja -C build
- name: Install linux armhf
run: |
@@ -159,13 +159,13 @@ jobs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up cache
id: cache
uses: actions/cache@v2
with:
path: |
build
key: linux-i686-v${{ env.CACHE_VERSION }}
#- name: Set up cache
#id: cache
#uses: actions/cache@v2
#with:
#path: |
#build
#key: linux-i686-v${{ env.CACHE_VERSION }}
- name: Fix GitHub's mess
run: |
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
@@ -222,13 +222,13 @@ jobs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up cache
id: cache
uses: actions/cache@v2
with:
path: |
build
key: linux-x86_64-v${{ env.CACHE_VERSION }}
#- name: Set up cache
#id: cache
#uses: actions/cache@v2
#with:
#path: |
#build
#key: linux-x86_64-v${{ env.CACHE_VERSION }}
- name: Set up dependencies
run: |
sudo apt-get update -qq
@@ -320,20 +320,20 @@ jobs:
runs-on: macos-10.15
steps:
- uses: actions/checkout@v2
- name: Set up cache
id: cache
uses: actions/cache@v2
with:
path: |
build
key: macos-intel-v${{ env.CACHE_VERSION }}
#- name: Set up cache
#id: cache
#uses: actions/cache@v2
#with:
#path: |
#build
#key: macos-intel-v${{ env.CACHE_VERSION }}
- name: Set up dependencies
run: |
brew install meson
- name: Build macOS intel
env:
CFLAGS: -arch x86_64 -mmacosx-version-min=10.8 -DMAC_OS_X_VERSION_MAX_ALLOWED=MAC_OS_X_VERSION_10_8 -DMAC_OS_X_VERSION_MIN_REQUIRED=MAC_OS_X_VERSION_10_8
CXXFLAGS: -arch x86_64 -mmacosx-version-min=10.8 -DMAC_OS_X_VERSION_MAX_ALLOWED=MAC_OS_X_VERSION_10_8 -DMAC_OS_X_VERSION_MIN_REQUIRED=MAC_OS_X_VERSION_10_8
CXXFLAGS: -arch x86_64 -mmacosx-version-min=10.8 -stdlib=libc++ -DMAC_OS_X_VERSION_MAX_ALLOWED=MAC_OS_X_VERSION_10_8 -DMAC_OS_X_VERSION_MIN_REQUIRED=MAC_OS_X_VERSION_10_8
LDFLAGS: -arch x86_64 -mmacosx-version-min=10.8 -stdlib=libc++
run: |
meson build --buildtype=release --prefix=/usr
@@ -365,13 +365,13 @@ jobs:
runs-on: macos-10.15
steps:
- uses: actions/checkout@v2
- name: Set up cache
id: cache
uses: actions/cache@v2
with:
path: |
build
key: macos-universal-v${{ env.CACHE_VERSION }}
#- name: Set up cache
#id: cache
#uses: actions/cache@v2
#with:
#path: |
#build
#key: macos-universal-v${{ env.CACHE_VERSION }}
- name: Fix up Xcode
run: |
sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*
@@ -414,13 +414,13 @@ jobs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up cache
id: cache
uses: actions/cache@v2
with:
path: |
build
key: win32-v${{ env.CACHE_VERSION }}
#- name: Set up cache
#id: cache
#uses: actions/cache@v2
#with:
#path: |
#build
#key: win32-v${{ env.CACHE_VERSION }}
- name: Fix GitHub's mess
run: |
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
@@ -463,13 +463,13 @@ jobs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up cache
id: cache
uses: actions/cache@v2
with:
path: |
build
key: win64-v${{ env.CACHE_VERSION }}
#- name: Set up cache
#id: cache
#uses: actions/cache@v2
#with:
#path: |
#build
#key: win64-v${{ env.CACHE_VERSION }}
- name: Fix GitHub's mess
run: |
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list


+ 24
- 13
meson.build View File

@@ -26,6 +26,8 @@ build_juce6_only = get_option('build-juce6-only')
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'
sse_optimizations = get_option('sse-optimizations') and buildtype != 'debug'

###############################################################################
# set paths
@@ -176,28 +178,37 @@ build_flags_release_cpp = [
'-fvisibility-inlines-hidden',
]

if optimizations or sse_optimizations
build_flags_release += [
'-ffast-math',
]
endif

if optimizations
build_flags_release += [
# common
'-ffast-math', '-fomit-frame-pointer', '-ftree-vectorize', '-funroll-loops',
# lto
'-fno-strict-aliasing', '-flto',
'-fomit-frame-pointer', '-ftree-vectorize', '-funroll-loops',
]
if not os_darwin
# common, gcc only
build_flags_release += [
'-fprefetch-loop-arrays',
]
endif
if build_machine.cpu_family().contains('x86') or build_universal
endif

if lto_optimizations
build_flags_release += [
'-fno-strict-aliasing', '-flto',
]
endif

if sse_optimizations or build_universal
build_flags_release += [
'-mtune=generic', '-msse', '-msse2',
]
if not build_universal
build_flags_release += [
'-mtune=generic', '-msse', '-msse2',
'-mfpmath=sse',
]
if not build_universal
build_flags_release += [
'-mfpmath=sse',
]
endif
endif
endif

@@ -254,7 +265,7 @@ link_flags_release = [
'-ffunction-sections',
]

if optimizations
if lto_optimizations
link_flags_release += [
'-Werror=odr',
'-Werror=lto-type-mismatch',


+ 13
- 1
meson_options.txt View File

@@ -1,7 +1,19 @@
option('optimizations',
type: 'boolean',
value: true,
description: 'Enable various optimizations',
description: 'Enable various math-related optimizations',
)

option('lto-optimizations',
type: 'boolean',
value: true,
description: 'Enable LTO optimizations',
)

option('sse-optimizations',
type: 'boolean',
value: true,
description: 'Enable SSE optimizations',
)

option('linux-embed',


+ 0
- 22
ports-juce5/meson.build View File

@@ -89,28 +89,6 @@ build_flags_plugin = [
'-Werror=deprecated-declarations',
]

build_flags_plugin_debug = [
]

build_flags_plugin_release = [
'-ffast-math',
]

if optimizations and not linux_embed
build_flags_plugin_release += [
'-mfpmath=sse',
]
endif

###############################################################################
# combine flags depending on build type

if buildtype == 'debug'
build_flags_plugin += build_flags_plugin_debug
else
build_flags_plugin += build_flags_plugin_release
endif

###############################################################################
# format-specific build flags



+ 0
- 22
ports-juce6/meson.build View File

@@ -28,32 +28,10 @@ build_flags_plugin = [
'-Werror=deprecated-declarations',
]

build_flags_plugin_debug = [
]

build_flags_plugin_release = [
'-ffast-math',
]

build_flag_plugin_cpp = [
'-std=gnu++14',
]

if optimizations and not linux_embed
build_flags_plugin_release += [
'-mfpmath=sse',
]
endif

###############################################################################
# combine flags depending on build type

if buildtype == 'debug'
build_flags_plugin += build_flags_plugin_debug
else
build_flags_plugin += build_flags_plugin_release
endif

###############################################################################
# format-specific build flags



Loading…
Cancel
Save