mirror of
https://github.com/mikeoliphant/neural-amp-modeler-lv2.git
synced 2026-05-06 19:50:11 +02:00
63 lines
1.7 KiB
CMake
63 lines
1.7 KiB
CMake
if (MSVC)
|
|
add_compile_options(
|
|
"$<$<CONFIG:DEBUG>:/W4>"
|
|
"$<$<CONFIG:RELEASE>:/O2>"
|
|
)
|
|
else()
|
|
add_compile_options(
|
|
-Wall
|
|
# -Wpedantic -Wextra -Wstrict-aliasing -Wunreachable-code -Weffc++ -Wno-unused-parameter
|
|
"$<$<CONFIG:DEBUG>:-Og;-ggdb>"
|
|
"$<$<CONFIG:RELWITHDEBINFO>:-Ofast>"
|
|
"$<$<CONFIG:RELEASE>:-Ofast>"
|
|
)
|
|
endif()
|
|
|
|
|
|
if (CMAKE_SYSTEM_PROCESSOR MATCHES "(amd64)|(AMD64)|(x86_64)")
|
|
option(USE_NATIVE_ARCH "Enable architecture-specific optimizations" OFF)
|
|
|
|
if (USE_NATIVE_ARCH)
|
|
add_compile_options(-march=x86-64-v3)
|
|
message("Enabling -march=x86-64-v3")
|
|
endif (USE_NATIVE_ARCH)
|
|
endif ()
|
|
|
|
add_subdirectory(../deps/NeuralAudio NeuralAudio)
|
|
|
|
set(SOURCES nam_lv2.cpp
|
|
nam_plugin.cpp
|
|
nam_plugin.h)
|
|
|
|
set(NA_SOURCES ../deps/NeuralAudio/NeuralAudio/NeuralModel.h)
|
|
|
|
add_library(neural_amp_modeler SHARED ${SOURCES} ${NA_SOURCES})
|
|
|
|
target_include_directories(neural_amp_modeler PUBLIC ../deps/NeuralAudio)
|
|
target_include_directories(neural_amp_modeler PUBLIC ../deps/lv2/include)
|
|
target_include_directories(neural_amp_modeler PUBLIC ../deps/denormal)
|
|
|
|
target_link_libraries(neural_amp_modeler PRIVATE 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)
|
|
|
|
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()
|