mirror of
https://github.com/mikeoliphant/neural-amp-modeler-lv2.git
synced 2026-05-13 20:10:00 +02:00
62 lines
1.7 KiB
CMake
62 lines
1.7 KiB
CMake
add_subdirectory(../deps/NeuralAudio NeuralAudio)
|
|
|
|
include_directories(SYSTEM ../deps/NeuralAudio)
|
|
include_directories(SYSTEM ../deps/lv2/include)
|
|
include_directories(SYSTEM ../deps/denormal)
|
|
|
|
set(SOURCES nam_lv2.cpp
|
|
nam_plugin.cpp
|
|
nam_plugin.h)
|
|
|
|
set(NA_SOURCES ../deps/NeuralAudio/NeuralAudio/NeuralModel.h)
|
|
|
|
add_library(neural_amp_modeler STATIC ${SOURCES} ${NA_SOURCES})
|
|
|
|
target_link_libraries(neural_amp_modeler INTERFACE NeuralAudio)
|
|
|
|
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${SOURCES})
|
|
source_group(NAM ${CMAKE_CURRENT_SOURCE_DIR} FILES ${NA_SOURCES})
|
|
|
|
option(DISABLE_DENORMALS "Disable floating point denormals" ON)
|
|
|
|
if (DISABLE_DENORMALS)
|
|
add_definitions(-DDISABLE_DENORMALS)
|
|
endif (DISABLE_DENORMALS)
|
|
|
|
if (CMAKE_SYSTEM_PROCESSOR MATCHES "(amd64)|(AMD64)|(x86_64)")
|
|
option(USE_NATIVE_ARCH "Enable architecture-specific optimizations" OFF)
|
|
|
|
if (USE_NATIVE_ARCH)
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=x86-64-v3")
|
|
message("Enabling -march=x86-64-v3")
|
|
endif (USE_NATIVE_ARCH)
|
|
endif ()
|
|
|
|
set_target_properties(neural_amp_modeler
|
|
PROPERTIES
|
|
CXX_VISIBILITY_PRESET hidden
|
|
INTERPROCEDURAL_OPTIMIZATION TRUE
|
|
PREFIX ""
|
|
)
|
|
|
|
# Platform
|
|
|
|
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
|
target_compile_definitions(neural_amp_modeler PRIVATE NOMINMAX WIN32_LEAN_AND_MEAN)
|
|
endif()
|
|
|
|
if (MSVC)
|
|
target_compile_options(neural_amp_modeler PRIVATE
|
|
"$<$<CONFIG:DEBUG>:/W4>"
|
|
"$<$<CONFIG:RELEASE>:/O2>"
|
|
)
|
|
else()
|
|
target_compile_options(neural_amp_modeler PRIVATE
|
|
-Wall
|
|
# -Wpedantic -Wextra -Wstrict-aliasing -Wunreachable-code -Weffc++ -Wno-unused-parameter
|
|
"$<$<CONFIG:DEBUG>:-Og;-ggdb>"
|
|
"$<$<CONFIG:RELWITHDEBINFO>:-Ofast>"
|
|
"$<$<CONFIG:RELEASE>:-Ofast>"
|
|
)
|
|
endif()
|