Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
cmake_minimum_required(VERSION 3.24.1)

# TODO figure this out
# https://stackoverflow.com/questions/47087237/cmake-and-ninja-rebuild-unnecessary-files
option(LINUX_REBUILD_WORKAROUND "ignore system headers for detecting dirty files" OFF)
if(LINUX_REBUILD_WORKAROUND)
file(
WRITE "${CMAKE_BINARY_DIR}/GNUMakeRulesOverwrite.cmake"
"STRING(REPLACE \"-MD\" \"-MMD\" CMAKE_DEPFILE_FLAGS_C \"\${CMAKE_DEPFILE_FLAGS_C}\")\n"
"STRING(REPLACE \"-MD\" \"-MMD\" CMAKE_DEPFILE_FLAGS_CXX \"\${CMAKE_DEPFILE_FLAGS_CXX}\")\n"
)
set(CMAKE_USER_MAKE_RULES_OVERRIDE "${CMAKE_BINARY_DIR}/GNUMakeRulesOverwrite.cmake" CACHE INTERNAL "")
endif()

project(VainSpectrumAnalyzer VERSION 1.0.0)

include(FetchContent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ static float getParameterValueFromFrequency(const float frequency)

const float num = std::log(frequency - MinFrequency);
const float den = std::log(MaxFrequency - MinFrequency);
return std::powf(num / den, 2.0f);
return std::pow(num / den, 2.0f);
}

//-----------------------------------------------------------------------------
Expand Down
7 changes: 7 additions & 0 deletions Tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ FetchContent_MakeAvailable(gtest)

add_executable(Tests Tests.cpp)

target_compile_definitions(
Tests
PUBLIC
JUCE_WEB_BROWSER=0
JUCE_USE_CURL=0
)

target_link_libraries(
Tests

Expand Down
4 changes: 2 additions & 2 deletions Tests/SpectrumAnalyzerTests.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,10 @@ TEST(SpectrumAnalyzerTests, SpectrumAnalyzerBufferTest)

float f{ 0.0f };
int loopCount2{ Size };
for(auto f : fftSpan)
for(auto ff : fftSpan)
{
loopCount2--;
EXPECT_EQ(f, f);
EXPECT_EQ(ff, f);
f += 1.0f;
}
EXPECT_EQ(loopCount2, 0);
Expand Down
Loading