You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.5 KiB

cmake_minimum_required(VERSION 3.26)
project(synth)
set(CMAKE_CXX_STANDARD 20)
set(BUILD_SHARED_LIBS OFF)
if(MSVC)
set(CMAKE_CXX_FLAGS_DEBUG "/W4 /DEBUG:FASTLINK /fp:fast")
set(CMAKE_CXX_FLAGS_RELEASE "/W4 /O2 /fp:fast /DNDEBUG")
else()
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g -ffast-math")
set(CMAKE_CXX_FLAGS_RELEASE "-Wall -Ofast -DNDEBUG")
endif()
if(WIN32)
option(PA_USE_ASIO "" ON)
option(PA_USE_WDMKS "" OFF)
option(PA_USE_WDMKS_DEVICE_INFO "" OFF)
endif()
add_subdirectory(lib/portaudio)
add_subdirectory(lib/portmidi)
add_subdirectory(lib/wxWidgets)
if(MSVC)
add_compile_definitions(_USE_MATH_DEFINES)
endif()
add_executable(main
src/synthapp.cpp
src/synthframe.cpp
src/ccslider.cpp
src/synth/synth.cpp
src/synth/voicemanager.cpp
src/synth/channel.cpp
src/synth/preset.cpp
src/synth/voice.cpp
src/synth/dsp/notelut.cpp
src/synth/dsp/centlut.cpp
src/synth/dsp/oscillator.cpp
src/synth/dsp/filter.cpp
src/synth/dsp/filterlut.cpp
src/synth/dsp/adsr.cpp)
target_include_directories(main PRIVATE include)
add_executable(genluts src/genluts.cpp)
target_include_directories(genluts PRIVATE include)
#target_compile_options(main PRIVATE -fsanitize=thread)
#target_link_options(main PRIVATE -fsanitize=thread)
target_link_libraries(main PRIVATE PortAudio)
target_link_libraries(main PRIVATE portmidi)
target_include_directories(main PRIVATE lib/portmidi/porttime)
target_link_libraries(main PRIVATE wxbase)
target_link_libraries(main PRIVATE wxcore)