Skip to content

Commit 82e3aad

Browse files
committed
Merge branch 'feature/github-action' into develop
2 parents 4d2ab27 + 3d65fb3 commit 82e3aad

File tree

6 files changed

+201
-4
lines changed

6 files changed

+201
-4
lines changed

.github/workflows/build.yml

Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
# Cetone Synth Series - GitHub Workflow
2+
# Based on Wasted Audio workflow (https://github.com/Wasted-Audio/wstd-eq/blob/master/.github/workflows/build.yml)
3+
4+
name: build
5+
6+
on:
7+
push:
8+
9+
jobs:
10+
linux-x86_64:
11+
runs-on: ubuntu-20.04
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v3
15+
with:
16+
submodules: recursive
17+
- name: Set up Python
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: 3.9
21+
- name: Install dependencies
22+
run: |
23+
sudo apt-get update -qq
24+
sudo apt-get install -yqq libgl1-mesa-dev
25+
26+
- name: Build plugins
27+
run: |
28+
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
29+
make -C build -j $(nproc)
30+
31+
- name: Set sha8 (non-release)
32+
if: startsWith(github.ref, 'refs/tags/') != true
33+
id: slug1
34+
run: echo "action_tag=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
35+
- name: Set tag (release)
36+
if: startsWith(github.ref, 'refs/tags/')
37+
id: slug2
38+
run: echo "action_tag=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
39+
40+
- name: Pack binaries
41+
run: |
42+
cd build
43+
mv bin ${{ github.event.repository.name }}
44+
tar -c -h -z -f ${{ github.event.repository.name }}-linux-x86_64-${{ github.event.pull_request.number || env.action_tag }}.tar.gz ${{ github.event.repository.name }}/
45+
- uses: actions/upload-artifact@v4
46+
with:
47+
name: ${{ github.event.repository.name }}-linux-x86_64-${{ github.event.pull_request.number || env.action_tag }}
48+
path: |
49+
build/*.tar.gz
50+
51+
- uses: softprops/action-gh-release@v1
52+
if: startsWith(github.ref, 'refs/tags/')
53+
with:
54+
tag_name: ${{ github.ref_name }}
55+
name: ${{ github.ref_name }}
56+
draft: false
57+
prerelease: false
58+
# files: |
59+
# WSTD_DL3Y/*.tar.gz
60+
61+
win64:
62+
runs-on: ubuntu-20.04
63+
steps:
64+
- name: Checkout repository
65+
uses: actions/checkout@v3
66+
with:
67+
submodules: recursive
68+
69+
- name: Install dependencies
70+
run: |
71+
sudo apt-get update -qq
72+
sudo apt-get install -yqq binutils-mingw-w64-x86-64 g++-mingw-w64-x86-64 mingw-w64 wine-stable
73+
- name: Deal with File does not contain a valid CIL image error
74+
run: |
75+
# See: https://github.com/orgs/community/discussions/64826 for more details.
76+
sudo apt remove --purge --auto-remove mono-runtime
77+
sudo apt-get install wine-binfmt
78+
79+
- name: Build win64 cross-compiled plugins
80+
env:
81+
EXE_WRAPPER: wine
82+
PKG_CONFIG: "false"
83+
WINEDEBUG: "-all"
84+
run: |
85+
echo "SET(CMAKE_SYSTEM_NAME Windows)" > windows-cross-build.cmake
86+
echo "SET(CMAKE_SYSTEM_PROCESSOR x86_64)" >> windows-cross-build.cmake
87+
echo "SET(CMAKE_C_COMPILER /usr/bin/x86_64-w64-mingw32-gcc)" >> windows-cross-build.cmake
88+
echo "SET(CMAKE_CXX_COMPILER /usr/bin/x86_64-w64-mingw32-g++)" >> windows-cross-build.cmake
89+
echo "SET(CMAKE_RC_COMPILER /usr/bin/x86_64-w64-mingw32-windres)" >> windows-cross-build.cmake
90+
echo "SET(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32/)" >> windows-cross-build.cmake
91+
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=windows-cross-build.cmake
92+
make -C build -j $(nproc)
93+
94+
- name: Set sha8 (non-release)
95+
if: startsWith(github.ref, 'refs/tags/') != true
96+
id: slug1
97+
run: echo "action_tag=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
98+
- name: Set tag (release)
99+
if: startsWith(github.ref, 'refs/tags/')
100+
id: slug2
101+
run: echo "action_tag=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
102+
- name: Pack binaries
103+
run: |
104+
cd build
105+
mv bin ${{ github.event.repository.name }}
106+
tar -c -h -z -f ${{ github.event.repository.name }}-win64-${{ github.event.pull_request.number || env.action_tag }}.tar.gz ${{ github.event.repository.name }}/
107+
- uses: actions/upload-artifact@v4
108+
with:
109+
name: ${{ github.event.repository.name }}-win64-${{ github.event.pull_request.number || env.action_tag }}
110+
path: |
111+
build/*.tar.gz
112+
113+
- uses: softprops/action-gh-release@v1
114+
if: startsWith(github.ref, 'refs/tags/')
115+
with:
116+
tag_name: ${{ github.ref_name }}
117+
name: ${{ github.ref_name }}
118+
draft: false
119+
prerelease: false
120+
# files: |
121+
# WSTD_DL3Y/*.tar.gz
122+
123+
macos-universal:
124+
runs-on: macos-14
125+
steps:
126+
- uses: actions/checkout@v3
127+
with:
128+
submodules: recursive
129+
130+
- name: Install dependencies
131+
run: |
132+
echo "No need to install dependencies on macOS."
133+
134+
- name: Build macOS universal plugins
135+
env:
136+
CFLAGS: -arch x86_64 -arch arm64 -mtune=generic -msse -msse2
137+
CXXFLAGS: -arch x86_64 -arch arm64 -mtune=generic -msse -msse2
138+
LDFLAGS: -arch x86_64 -arch arm64
139+
run: |
140+
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
141+
make -C build NOOPT=true -j $(sysctl -n hw.logicalcpu)
142+
cd build && ../dpf/utils/package-osx-bundles.sh
143+
144+
- name: Set sha8 (non-release)
145+
if: startsWith(github.ref, 'refs/tags/') != true
146+
id: slug1
147+
run: echo "action_tag=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
148+
- name: Set tag (release)
149+
if: startsWith(github.ref, 'refs/tags/')
150+
id: slug2
151+
run: echo "action_tag=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
152+
153+
- uses: actions/upload-artifact@v4
154+
with:
155+
name: ${{ github.event.repository.name }}-macOS-universal-${{ github.event.pull_request.number || env.action_tag }}
156+
path: |
157+
build/*-macOS.pkg
158+
159+
- uses: softprops/action-gh-release@v1
160+
if: startsWith(github.ref, 'refs/tags/')
161+
with:
162+
tag_name: ${{ github.ref_name }}
163+
name: ${{ github.ref_name }}
164+
draft: false
165+
prerelease: false
166+
# files: |
167+
# WSTD_DL3Y/*-macOS.pkg

CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ project (minaton
77

88
add_subdirectory (dpf)
99

10+
# Explicitly specify C++ standard
11+
set (CMAKE_CXX_STANDARD 17)
12+
1013
# Add our CMake extention module path
1114
list (APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
1215

@@ -74,7 +77,10 @@ make_directory (${GENERATED_WAVES_DIR})
7477

7578
# Binary-to-C converter from Dear ImGui
7679
add_executable (binary_to_compressed_c utils/binary_to_compressed_c.cpp)
77-
target_link_options (binary_to_compressed_c PRIVATE -static)
80+
# Only build static converter on Win32 or MinGW cross-compiling
81+
if (WIN32 AND NOT MSVC)
82+
target_link_options (binary_to_compressed_c PRIVATE -static)
83+
endif ()
7884

7985
set (WAVES_DIR ${PROJECT_SOURCE_DIR}/src/waves)
8086
set (GENERATED_WAVE_HEADER ${GENERATED_WAVES_DIR}/minaton_waves.hpp)

src/stb_decompress.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515
//-----------------------------------------------------------------------------
1616

1717
#include <assert.h>
18-
#include <malloc.h>
18+
#if defined(__linux__) || defined(__GLIBC__)
19+
# include <malloc.h> // Linux
20+
#else
21+
# include <stdlib.h> // macOS / *BSD
22+
#endif
1923
#include <memory.h>
2024

2125
//=========================================================

vendor/libsamplerate/src/common.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ SRC_STATE *zoh_state_new (int channels, SRC_ERROR *error) ;
172172

173173
static inline int psf_lrintf (float x)
174174
{
175-
#ifdef HAVE_IMMINTRIN_H
175+
#if HAVE_IMMINTRIN_H
176176
return _mm_cvtss_si32 (_mm_load_ss (&x)) ;
177177
#else
178178
return lrintf (x) ;
@@ -181,7 +181,7 @@ static inline int psf_lrintf (float x)
181181

182182
static inline int psf_lrint (double x)
183183
{
184-
#ifdef HAVE_IMMINTRIN_H
184+
#if HAVE_IMMINTRIN_H
185185
return _mm_cvtsd_si32 (_mm_load_sd (&x)) ;
186186
#else
187187
return lrint (x) ;

vendor/libsndfile/src/config.h.cmake

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
/* AnClark modification 2025/9/25: Only enable SSE2 on x86 platform */
2+
/* Determine if your platform is x86 / x86_64. Ported from libsndfile. */
3+
#if (defined __x86_64__) || (defined _M_X64)
4+
#define CPU_IS_X86_64 1 /* Define both for x86_64 */
5+
#define CPU_IS_X86 1
6+
#elif defined (__i486__) || defined (__i586__) || defined (__i686__) || defined (_M_IX86)
7+
#define CPU_IS_X86 1
8+
#define CPU_IS_X86_64 0
9+
#else
10+
#define CPU_IS_X86 0
11+
#define CPU_IS_X86_64 0
12+
#endif
13+
114
/* Set to 1 if the compile is GNU GCC. */
215
#cmakedefine01 COMPILER_IS_GCC
316

@@ -176,7 +189,9 @@
176189
#cmakedefine01 HAVE_UNISTD_H
177190

178191
/* Define to 1 if you have the <immintrin.h> header file. */
192+
#if CPU_IS_X86
179193
#cmakedefine01 HAVE_IMMINTRIN_H
194+
#endif
180195

181196
/* Define to 1 if you have the <stdbool.h> header file. */
182197
#cmakedefine01 HAVE_STDBOOL_H
@@ -200,7 +215,9 @@
200215
#cmakedefine01 OS_IS_WIN32
201216

202217
/* Set to 1 if SSE2 is enabled */
218+
#if CPU_IS_X86
203219
#cmakedefine USE_SSE2
220+
#endif
204221

205222
/* Name of package */
206223
#define PACKAGE "@PACKAGE_NAME@"

vendor/libsndfile/src/sfconfig.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,12 @@
124124
#define CPU_IS_X86_64 0
125125
#endif
126126

127+
/* AnClark modification 2025/9/25: Only enable SSE2 on x86 platform */
128+
#if CPU_IS_X86
127129
#if (defined (__SSE2__) || defined (_M_AMD64) || (defined (_M_IX86_FP) && (_M_IX86_FP >= 2)) && HAVE_IMMINTRIN_H)
128130
#define USE_SSE2
129131
#endif
132+
#endif
130133

131134
#ifndef HAVE_SSIZE_T
132135
#define HAVE_SSIZE_T 0

0 commit comments

Comments
 (0)