2017-11-14 04:52:03 +00:00
|
|
|
cmake_minimum_required(VERSION 3.10 FATAL_ERROR) # because of c++17
|
2017-06-18 02:48:52 +00:00
|
|
|
|
2016-05-25 02:00:22 +00:00
|
|
|
project(amuse)
|
|
|
|
|
2020-04-11 04:59:16 +00:00
|
|
|
if (NOT MSVC)
|
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
endif()
|
2017-06-18 02:48:52 +00:00
|
|
|
|
|
|
|
if(NOT MSVC)
|
2019-08-25 08:28:25 +00:00
|
|
|
add_compile_options(-Wno-narrowing)
|
2017-06-18 02:48:52 +00:00
|
|
|
endif()
|
2019-08-25 08:21:59 +00:00
|
|
|
|
2016-07-18 17:52:17 +00:00
|
|
|
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/boo AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/athena)
|
|
|
|
message(STATUS "Preparing standalone build")
|
2016-05-25 02:00:22 +00:00
|
|
|
add_subdirectory(boo)
|
2016-07-18 17:52:17 +00:00
|
|
|
add_subdirectory(athena)
|
2016-05-25 02:00:22 +00:00
|
|
|
endif()
|
|
|
|
|
2019-08-25 08:21:59 +00:00
|
|
|
add_library(amuse
|
|
|
|
lib/AudioGroup.cpp
|
|
|
|
lib/AudioGroupData.cpp
|
|
|
|
lib/AudioGroupPool.cpp
|
|
|
|
lib/AudioGroupProject.cpp
|
|
|
|
lib/AudioGroupSampleDirectory.cpp
|
|
|
|
lib/Common.cpp
|
|
|
|
lib/ContainerRegistry.cpp
|
|
|
|
lib/DirectoryEnumerator.cpp
|
|
|
|
lib/DSPCodec.cpp
|
|
|
|
lib/EffectChorus.cpp
|
|
|
|
lib/EffectDelay.cpp
|
|
|
|
lib/EffectReverb.cpp
|
|
|
|
lib/Emitter.cpp
|
|
|
|
lib/Engine.cpp
|
|
|
|
lib/Envelope.cpp
|
|
|
|
lib/Listener.cpp
|
|
|
|
lib/N64MusyXCodec.cpp
|
|
|
|
lib/Sequencer.cpp
|
|
|
|
lib/SongConverter.cpp
|
|
|
|
lib/SongState.cpp
|
|
|
|
lib/SoundMacroState.cpp
|
|
|
|
lib/Studio.cpp
|
|
|
|
lib/Submix.cpp
|
|
|
|
lib/Voice.cpp
|
|
|
|
lib/VolumeTable.cpp
|
|
|
|
|
|
|
|
include/amuse/amuse.hpp
|
|
|
|
include/amuse/AudioGroup.hpp
|
|
|
|
include/amuse/AudioGroupData.hpp
|
|
|
|
include/amuse/AudioGroupPool.hpp
|
|
|
|
include/amuse/AudioGroupProject.hpp
|
|
|
|
include/amuse/AudioGroupSampleDirectory.hpp
|
|
|
|
include/amuse/Common.hpp
|
|
|
|
include/amuse/ContainerRegistry.hpp
|
|
|
|
include/amuse/DirectoryEnumerator.hpp
|
|
|
|
include/amuse/DSPCodec.hpp
|
|
|
|
include/amuse/EffectBase.hpp
|
|
|
|
include/amuse/EffectChorus.hpp
|
|
|
|
include/amuse/EffectDelay.hpp
|
|
|
|
include/amuse/EffectReverb.hpp
|
|
|
|
include/amuse/Emitter.hpp
|
|
|
|
include/amuse/Engine.hpp
|
|
|
|
include/amuse/Entity.hpp
|
|
|
|
include/amuse/Envelope.hpp
|
|
|
|
include/amuse/IBackendSubmix.hpp
|
|
|
|
include/amuse/IBackendVoice.hpp
|
|
|
|
include/amuse/IBackendVoiceAllocator.hpp
|
|
|
|
include/amuse/Listener.hpp
|
|
|
|
include/amuse/N64MusyXCodec.hpp
|
|
|
|
include/amuse/Sequencer.hpp
|
|
|
|
include/amuse/SongConverter.hpp
|
|
|
|
include/amuse/SoundMacroState.hpp
|
|
|
|
include/amuse/SongState.hpp
|
|
|
|
include/amuse/Submix.hpp
|
|
|
|
include/amuse/Studio.hpp
|
|
|
|
include/amuse/Voice.hpp
|
|
|
|
include/amuse/VolumeTable.hpp
|
|
|
|
)
|
2016-05-03 01:16:26 +00:00
|
|
|
|
2019-06-12 02:02:52 +00:00
|
|
|
target_atdna(amuse atdna_AudioGroupPool.cpp include/amuse/AudioGroupPool.hpp)
|
|
|
|
target_atdna(amuse atdna_AudioGroupProject.cpp include/amuse/AudioGroupProject.hpp)
|
|
|
|
target_atdna(amuse atdna_AudioGroupSampleDirectory.cpp include/amuse/AudioGroupSampleDirectory.hpp)
|
2019-09-11 00:40:24 +00:00
|
|
|
|
2019-06-12 02:02:52 +00:00
|
|
|
target_include_directories(amuse PUBLIC include)
|
2019-09-11 00:40:24 +00:00
|
|
|
target_link_libraries(amuse
|
|
|
|
athena-core
|
|
|
|
lzokay
|
|
|
|
${ZLIB_LIBRARIES}
|
|
|
|
)
|
|
|
|
|
|
|
|
if(NX)
|
|
|
|
target_sources(amuse PRIVATE include/switch_math.hpp)
|
|
|
|
endif()
|
|
|
|
|
2019-06-12 02:02:52 +00:00
|
|
|
if(TARGET boo)
|
|
|
|
target_sources(amuse PRIVATE lib/BooBackend.cpp include/amuse/BooBackend.hpp)
|
|
|
|
target_link_libraries(amuse boo)
|
|
|
|
endif()
|
2019-09-11 00:40:24 +00:00
|
|
|
|
|
|
|
if (MSVC)
|
|
|
|
target_compile_options(amuse PRIVATE
|
|
|
|
# Enforce various standards compliant behavior.
|
2020-04-11 04:59:16 +00:00
|
|
|
$<$<COMPILE_LANGUAGE:CXX>:/permissive->
|
2019-09-11 00:40:24 +00:00
|
|
|
|
|
|
|
# Enable standard volatile semantics.
|
2020-04-11 04:59:16 +00:00
|
|
|
$<$<COMPILE_LANGUAGE:CXX>:/volatile:iso>
|
2019-09-11 00:40:24 +00:00
|
|
|
|
|
|
|
# Reports the proper value for the __cplusplus preprocessor macro.
|
2020-04-11 04:59:16 +00:00
|
|
|
$<$<COMPILE_LANGUAGE:CXX>:/Zc:__cplusplus>
|
2019-09-11 00:40:24 +00:00
|
|
|
|
2020-04-11 04:59:16 +00:00
|
|
|
# Use latest C++ standard.
|
|
|
|
$<$<COMPILE_LANGUAGE:CXX>:/std:c++latest>
|
2019-09-11 00:40:24 +00:00
|
|
|
)
|
2020-04-11 04:59:16 +00:00
|
|
|
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
|
|
|
# Flags for MSVC (not clang-cl)
|
|
|
|
target_compile_options(amuse PRIVATE
|
|
|
|
# Allow constexpr variables to have explicit external linkage.
|
|
|
|
$<$<COMPILE_LANGUAGE:CXX>:/Zc:externConstexpr>
|
|
|
|
|
|
|
|
# Assume that new throws exceptions, allowing better code generation.
|
|
|
|
$<$<COMPILE_LANGUAGE:CXX>:/Zc:throwingNew>
|
|
|
|
)
|
|
|
|
endif()
|
2019-09-11 00:40:24 +00:00
|
|
|
else()
|
2019-06-12 02:02:52 +00:00
|
|
|
target_compile_options(amuse PRIVATE -Wno-unknown-pragmas)
|
|
|
|
endif()
|
2019-09-11 00:40:24 +00:00
|
|
|
|
2017-12-12 02:05:54 +00:00
|
|
|
if(COMMAND add_sanitizers)
|
|
|
|
add_sanitizers(amuse)
|
|
|
|
endif()
|
2016-05-09 07:22:58 +00:00
|
|
|
|
2018-10-07 02:54:56 +00:00
|
|
|
if(TARGET boo AND NOT WINDOWS_STORE AND NOT NX)
|
2016-05-29 18:22:20 +00:00
|
|
|
# AudioUnit Target (OS X only)
|
|
|
|
add_subdirectory(AudioUnit)
|
2016-05-25 02:00:22 +00:00
|
|
|
|
2016-05-29 18:22:20 +00:00
|
|
|
# VST Target
|
|
|
|
add_subdirectory(VST)
|
2016-05-25 02:00:22 +00:00
|
|
|
|
2016-06-21 06:40:13 +00:00
|
|
|
# Multi-platform CLI tools
|
|
|
|
|
|
|
|
# Player
|
|
|
|
add_executable(amuseplay WIN32 driver/amuseplay.cpp)
|
2019-06-12 02:02:52 +00:00
|
|
|
target_link_libraries(amuseplay amuse logvisor)
|
2016-06-21 06:40:13 +00:00
|
|
|
|
|
|
|
# Converter
|
|
|
|
add_executable(amuseconv driver/amuseconv.cpp)
|
2019-06-12 02:02:52 +00:00
|
|
|
target_link_libraries(amuseconv amuse logvisor)
|
2016-07-06 21:30:46 +00:00
|
|
|
|
|
|
|
# Renderer
|
|
|
|
add_executable(amuserender driver/amuserender.cpp)
|
2019-06-12 02:02:52 +00:00
|
|
|
target_link_libraries(amuserender amuse logvisor)
|
2018-03-15 00:25:29 +00:00
|
|
|
|
2018-05-06 23:06:49 +00:00
|
|
|
if(COMMAND add_sanitizers)
|
|
|
|
add_sanitizers(amuseplay)
|
|
|
|
add_sanitizers(amuseconv)
|
|
|
|
add_sanitizers(amuserender)
|
|
|
|
endif()
|
|
|
|
|
2018-03-15 00:25:29 +00:00
|
|
|
# Editor
|
2020-05-24 16:02:39 +00:00
|
|
|
find_package(Qt5 COMPONENTS Widgets PATHS /usr/local/opt/qt)
|
2018-03-15 00:25:29 +00:00
|
|
|
if (Qt5Widgets_FOUND)
|
|
|
|
message(STATUS "Qt5 found, amuse-gui will be built")
|
|
|
|
add_subdirectory(Editor)
|
|
|
|
else()
|
|
|
|
message(STATUS "Qt5 not found, amuse-gui will not be built")
|
|
|
|
endif()
|
2016-05-09 07:22:58 +00:00
|
|
|
endif()
|