Skip to content

Commit 97be403

Browse files
committed
static link fftw in CI builds, fix compiler warnings
1 parent 7cb58e5 commit 97be403

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
sudo apt-get install -y libobs-dev libfftw3-dev
2424
2525
- name: 'Cmake'
26-
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/bin
26+
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DSTATIC_FFTW=ON -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/bin
2727

2828
- name: 'Build'
2929
working-directory: ${{github.workspace}}/build

CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
1818
endif()
1919

2020
option(BUILD_SHARED_LIBS "Build shared libraries" OFF) # static link dependencies
21+
if(NOT MSVC)
22+
option(STATIC_FFTW "Static link FFTW" OFF) # allow static linking FFTW on non-windows platforms
23+
endif()
2124

2225
if(WIN32)
2326
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
@@ -54,7 +57,11 @@ if(MSVC)
5457
set(FFTW_INCLUDE_DIRS "deps/fftw-3.3.10/api")
5558
else()
5659
find_path(FFTW_INCLUDE_DIRS fftw3.h)
57-
find_library(FFTW_LIBRARIES fftw3f)
60+
if(STATIC_FFTW)
61+
find_library(FFTW_LIBRARIES libfftw3f.a)
62+
else()
63+
find_library(FFTW_LIBRARIES fftw3f)
64+
endif()
5865
if(NOT FFTW_INCLUDE_DIRS)
5966
message(FATAL_ERROR "Could not locate FFTW header.")
6067
endif()

changelog.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ or
2121
### Linux (Ubuntu 20.04)
2222
#### Prebuilt Binaries
2323
- Extract Waveform\_v#.#.#\_Ubuntu\_x64.tar.gz to your `~/.config/obs-studio/plugins` folder.
24-
- Install FFTW `sudo apt-get install libfftw3-3`
2524

2625
#### Source Build
2726
- Step-by-step instructions in the [readme](https://github.com/phandasm/waveform/blob/master/README.md#linux-ubuntu-20043-lts).

src/source.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ void WAVSource::render_bars([[maybe_unused]] gs_effect_t *effect)
764764
const auto cpos = m_stereo ? center : bottom;
765765

766766
auto max_steps = (size_t)(cpos / step_stride);
767-
if(((int)cpos - (max_steps * step_stride)) >= m_step_width)
767+
if(((int)cpos - (int)(max_steps * step_stride)) >= m_step_width)
768768
++max_steps;
769769

770770
// vertex buffer
@@ -880,7 +880,7 @@ void WAVSource::render_bars([[maybe_unused]] gs_effect_t *effect)
880880

881881
if(m_display_mode == DisplayMode::STEPPED_BAR)
882882
{
883-
for(auto j = 0; j < max_steps; ++j)
883+
for(auto j = 0u; j < max_steps; ++j)
884884
{
885885
auto y1 = (float)(j * step_stride);
886886
auto y2 = y1 + m_step_width;

0 commit comments

Comments
 (0)