2021-05-11 16:08:08 -04:00
|
|
|
cmake_minimum_required(VERSION 3.0)
|
2022-01-31 16:33:37 -05:00
|
|
|
|
|
|
|
if (APPLE)
|
|
|
|
set(MACOSX_DEPLOYMENT_TARGET 10.9)
|
|
|
|
endif()
|
|
|
|
|
2021-05-13 04:22:57 -04:00
|
|
|
project(furnace)
|
2021-05-11 16:08:08 -04:00
|
|
|
|
2022-02-08 02:04:23 -05:00
|
|
|
if (APPLE)
|
|
|
|
enable_language(OBJC)
|
|
|
|
endif()
|
|
|
|
|
2021-12-09 03:37:31 -05:00
|
|
|
set(CMAKE_CXX_STANDARD 14)
|
2022-05-06 06:40:33 -04:00
|
|
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
2021-05-11 16:08:08 -04:00
|
|
|
|
2021-12-24 18:12:36 -05:00
|
|
|
set(CMAKE_PROJECT_VERSION_MAJOR 0)
|
2022-04-01 06:24:35 -04:00
|
|
|
set(CMAKE_PROJECT_VERSION_MINOR 6)
|
|
|
|
set(CMAKE_PROJECT_VERSION_PATCH 0)
|
2021-12-24 18:12:36 -05:00
|
|
|
|
2022-05-08 16:59:42 -04:00
|
|
|
set(BUILD_GUI_DEFAULT ON)
|
2022-05-22 20:01:50 -04:00
|
|
|
set(USE_SDL2_DEFAULT ON)
|
|
|
|
set(USE_SNDFILE_DEFAULT ON)
|
2022-05-08 16:59:42 -04:00
|
|
|
set(SYSTEM_SDL2_DEFAULT OFF)
|
|
|
|
|
2021-12-11 02:10:09 -05:00
|
|
|
if (ANDROID)
|
2022-02-21 13:47:49 -05:00
|
|
|
set(USE_RTMIDI_DEFAULT OFF)
|
2022-05-24 14:06:29 -04:00
|
|
|
set(USE_BACKWARD_DEFAULT OFF)
|
2022-05-27 16:51:57 -04:00
|
|
|
find_library(TERMUX rt)
|
|
|
|
if (TERMUX)
|
|
|
|
message(STATUS "Termux detected")
|
|
|
|
endif()
|
2021-12-11 02:10:09 -05:00
|
|
|
else()
|
2022-02-21 13:47:49 -05:00
|
|
|
set(USE_RTMIDI_DEFAULT ON)
|
2022-05-24 14:06:29 -04:00
|
|
|
set(USE_BACKWARD_DEFAULT ON)
|
2021-12-11 02:10:09 -05:00
|
|
|
endif()
|
|
|
|
|
2022-02-01 15:50:25 -05:00
|
|
|
find_package(PkgConfig)
|
2022-05-08 16:59:42 -04:00
|
|
|
if (PKG_CONFIG_FOUND AND NOT ANDROID)
|
2022-02-01 15:50:25 -05:00
|
|
|
pkg_check_modules(JACK jack)
|
|
|
|
set(WITH_JACK_DEFAULT ${JACK_FOUND})
|
|
|
|
else()
|
|
|
|
set(WITH_JACK_DEFAULT OFF)
|
|
|
|
endif()
|
2021-12-11 16:44:02 -05:00
|
|
|
|
2022-02-01 15:50:25 -05:00
|
|
|
option(BUILD_GUI "Build the tracker (disable to build only a headless player)" ${BUILD_GUI_DEFAULT})
|
2022-05-22 20:01:50 -04:00
|
|
|
option(USE_RTMIDI "Build with MIDI support using RtMidi." ${USE_RTMIDI_DEFAULT})
|
|
|
|
option(USE_SDL2 "Build with SDL2. Required to build with GUI." ${USE_SDL2_DEFAULT})
|
|
|
|
option(USE_SNDFILE "Build with libsndfile. Required in order to work with audio files." ${USE_SNDFILE_DEFAULT})
|
2022-05-24 14:06:29 -04:00
|
|
|
option(USE_BACKWARD "Use backward-cpp to print a backtrace on crash/abort." ${USE_BACKWARD_DEFAULT})
|
2022-02-01 15:50:25 -05:00
|
|
|
option(WITH_JACK "Whether to build with JACK support. Auto-detects if JACK is available" ${WITH_JACK_DEFAULT})
|
2022-05-31 04:24:29 -04:00
|
|
|
option(SYSTEM_FFTW "Use a system-installed version of FFTW instead of the vendored one" OFF)
|
2022-02-01 15:50:25 -05:00
|
|
|
option(SYSTEM_FMT "Use a system-installed version of fmt instead of the vendored one" OFF)
|
|
|
|
option(SYSTEM_LIBSNDFILE "Use a system-installed version of libsndfile instead of the vendored one" OFF)
|
2022-02-13 15:02:43 -05:00
|
|
|
option(SYSTEM_RTMIDI "Use a system-installed version of RtMidi instead of the vendored one" OFF)
|
2022-02-01 15:50:25 -05:00
|
|
|
option(SYSTEM_ZLIB "Use a system-installed version of zlib instead of the vendored one" OFF)
|
2022-02-01 16:05:01 -05:00
|
|
|
option(SYSTEM_SDL2 "Use a system-installed version of SDL2 instead of the vendored one" ${SYSTEM_SDL2_DEFAULT})
|
2022-02-01 15:50:25 -05:00
|
|
|
option(WARNINGS_ARE_ERRORS "Whether warnings in furnace's C++ code should be treated as errors" OFF)
|
|
|
|
|
|
|
|
set(DEPENDENCIES_INCLUDE_DIRS "")
|
2022-05-11 17:09:23 -04:00
|
|
|
|
2022-05-27 16:51:57 -04:00
|
|
|
if (ANDROID AND NOT TERMUX)
|
2022-05-11 17:09:23 -04:00
|
|
|
set(DEPENDENCIES_DEFINES "IS_MOBILE")
|
|
|
|
else()
|
2022-02-01 15:50:25 -05:00
|
|
|
set(DEPENDENCIES_DEFINES "")
|
2022-05-11 17:09:23 -04:00
|
|
|
endif()
|
|
|
|
|
2022-02-01 15:50:25 -05:00
|
|
|
set(DEPENDENCIES_COMPILE_OPTIONS "")
|
|
|
|
set(DEPENDENCIES_LIBRARIES "")
|
|
|
|
set(DEPENDENCIES_LIBRARY_DIRS "")
|
|
|
|
set(DEPENDENCIES_LINK_OPTIONS "")
|
|
|
|
set(DEPENDENCIES_LEGACY_LDFLAGS "")
|
|
|
|
|
2022-02-01 16:05:01 -05:00
|
|
|
if (BUILD_GUI)
|
|
|
|
set(SYSTEM_SDL_MIN_VER 2.0.18)
|
|
|
|
else()
|
|
|
|
set(SYSTEM_SDL_MIN_VER 2.0.0)
|
|
|
|
endif()
|
|
|
|
|
2022-02-13 17:02:49 -05:00
|
|
|
list(APPEND DEPENDENCIES_INCLUDE_DIRS "extern/SAASound/include")
|
|
|
|
|
2022-02-01 15:50:25 -05:00
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
list(APPEND DEPENDENCIES_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
|
|
|
|
|
2022-05-31 04:24:29 -04:00
|
|
|
if (SYSTEM_FFTW)
|
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
pkg_check_modules(FFTW REQUIRED fftw3>=3.3)
|
|
|
|
list(APPEND DEPENDENCIES_INCLUDE_DIRS ${FFTW_INCLUDE_DIRS})
|
|
|
|
list(APPEND DEPENDENCIES_COMPILE_OPTIONS ${FFTW_CFLAGS_OTHER})
|
|
|
|
list(APPEND DEPENDENCIES_LIBRARIES ${FFTW_LIBRARIES})
|
|
|
|
list(APPEND DEPENDENCIES_LIBRARY_DIRS ${FFTW_LIBRARY_DIRS})
|
|
|
|
list(APPEND DEPENDENCIES_LINK_OPTIONS ${FFTW_LDFLAGS_OTHER})
|
|
|
|
list(APPEND DEPENDENCIES_LEGACY_LDFLAGS ${FFTW_LDFLAGS})
|
|
|
|
message(STATUS "Using system-installed FFTW")
|
|
|
|
else()
|
2022-05-31 13:42:47 -04:00
|
|
|
if (WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
|
|
|
set(WITH_OUR_MALLOC ON CACHE BOOL "aaa" FORCE)
|
|
|
|
endif()
|
2022-05-31 04:24:29 -04:00
|
|
|
add_subdirectory(extern/fftw EXCLUDE_FROM_ALL)
|
|
|
|
list(APPEND DEPENDENCIES_INCLUDE_DIRS extern/fftw/api)
|
|
|
|
list(APPEND DEPENDENCIES_LIBRARIES fftw3)
|
|
|
|
message(STATUS "Using vendored FFTW")
|
|
|
|
endif()
|
|
|
|
|
2022-02-01 15:50:25 -05:00
|
|
|
if (SYSTEM_FMT)
|
|
|
|
if (PKG_CONFIG_FOUND)
|
2022-04-11 03:05:58 -04:00
|
|
|
pkg_check_modules(FMT fmt>=7.1.0)
|
2022-02-01 15:50:25 -05:00
|
|
|
if (FMT_FOUND)
|
|
|
|
list(APPEND DEPENDENCIES_INCLUDE_DIRS ${FMT_INCLUDE_DIRS})
|
|
|
|
list(APPEND DEPENDENCIES_COMPILE_OPTIONS ${FMT_CFLAGS_OTHER})
|
|
|
|
list(APPEND DEPENDENCIES_LIBRARIES ${FMT_LIBRARIES})
|
|
|
|
list(APPEND DEPENDENCIES_LIBRARY_DIRS ${FMT_LIBRARY_DIRS})
|
|
|
|
list(APPEND DEPENDENCIES_LINK_OPTIONS ${FMT_LDFLAGS_OTHER})
|
|
|
|
list(APPEND DEPENDENCIES_LEGACY_LDFLAGS ${FMT_LDFLAGS})
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
if (NOT FMT_FOUND)
|
|
|
|
find_package(fmt REQUIRED)
|
|
|
|
list(APPEND DEPENDENCIES_LIBRARIES fmt::fmt)
|
|
|
|
endif()
|
|
|
|
message(STATUS "Using system-installed fmt")
|
|
|
|
else()
|
2022-01-18 01:00:08 -05:00
|
|
|
add_subdirectory(extern/fmt EXCLUDE_FROM_ALL)
|
2022-02-01 15:50:25 -05:00
|
|
|
list(APPEND DEPENDENCIES_INCLUDE_DIRS extern/fmt/include)
|
|
|
|
list(APPEND DEPENDENCIES_LIBRARIES fmt)
|
|
|
|
message(STATUS "Using vendored fmt")
|
2022-01-18 00:45:17 -05:00
|
|
|
endif()
|
2021-12-30 17:31:08 -05:00
|
|
|
|
2022-05-22 20:01:50 -04:00
|
|
|
if (USE_SNDFILE)
|
|
|
|
list(APPEND DEPENDENCIES_DEFINES HAVE_SNDFILE)
|
|
|
|
if (SYSTEM_LIBSNDFILE)
|
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
pkg_check_modules(LIBSNDFILE REQUIRED sndfile)
|
|
|
|
list(APPEND DEPENDENCIES_INCLUDE_DIRS ${LIBSNDFILE_INCLUDE_DIRS})
|
|
|
|
list(APPEND DEPENDENCIES_COMPILE_OPTIONS ${LIBSNDFILE_CFLAGS_OTHER})
|
|
|
|
list(APPEND DEPENDENCIES_LIBRARIES ${LIBSNDFILE_LIBRARIES})
|
|
|
|
list(APPEND DEPENDENCIES_LIBRARY_DIRS ${LIBSNDFILE_LIBRARY_DIRS})
|
|
|
|
list(APPEND DEPENDENCIES_LINK_OPTIONS ${LIBSNDFILE_LDFLAGS_OTHER})
|
|
|
|
list(APPEND DEPENDENCIES_LEGACY_LDFLAGS ${LIBSNDFILE_LDFLAGS})
|
|
|
|
message(STATUS "Using system-installed libsndfile")
|
|
|
|
else()
|
|
|
|
set(BUILD_TESTING OFF CACHE BOOL "aaaaaa" FORCE)
|
|
|
|
set(BUILD_PROGRAMS OFF CACHE BOOL "aaa" FORCE)
|
|
|
|
set(BUILD_EXAMPLES OFF CACHE BOOL "a" FORCE)
|
|
|
|
set(ENABLE_EXTERNAL_LIBS OFF CACHE BOOL "come on" FORCE)
|
|
|
|
set(ENABLE_MPEG OFF CACHE BOOL "come on" FORCE)
|
|
|
|
add_subdirectory(extern/libsndfile EXCLUDE_FROM_ALL)
|
|
|
|
list(APPEND DEPENDENCIES_LIBRARIES sndfile)
|
|
|
|
message(STATUS "Using vendored libsndfile")
|
|
|
|
endif()
|
2022-02-01 15:50:25 -05:00
|
|
|
else()
|
2022-05-22 20:01:50 -04:00
|
|
|
message(STATUS "Not using libsndfile")
|
2022-02-01 15:50:25 -05:00
|
|
|
endif()
|
2021-12-07 12:21:23 -05:00
|
|
|
|
2022-02-21 13:47:49 -05:00
|
|
|
if (USE_RTMIDI)
|
|
|
|
if (SYSTEM_RTMIDI)
|
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
pkg_check_modules(RTMIDI REQUIRED rtmidi)
|
|
|
|
list(APPEND DEPENDENCIES_INCLUDE_DIRS ${RTMIDI_INCLUDE_DIRS})
|
|
|
|
list(APPEND DEPENDENCIES_COMPILE_OPTIONS ${RTMIDI_CFLAGS_OTHER})
|
|
|
|
list(APPEND DEPENDENCIES_LIBRARIES ${RTMIDI_LIBRARIES})
|
|
|
|
list(APPEND DEPENDENCIES_LIBRARY_DIRS ${RTMIDI_LIBRARY_DIRS})
|
|
|
|
list(APPEND DEPENDENCIES_LINK_OPTIONS ${RTMIDI_LDFLAGS_OTHER})
|
|
|
|
list(APPEND DEPENDENCIES_LEGACY_LDFLAGS ${RTMIDI_LDFLAGS})
|
|
|
|
message(STATUS "Using system-installed RtMidi")
|
|
|
|
else()
|
|
|
|
add_subdirectory(extern/rtmidi EXCLUDE_FROM_ALL)
|
|
|
|
list(APPEND DEPENDENCIES_LIBRARIES rtmidi)
|
|
|
|
message(STATUS "Using vendored RtMidi")
|
|
|
|
endif()
|
2022-02-13 15:02:43 -05:00
|
|
|
endif()
|
|
|
|
|
2022-02-01 15:50:25 -05:00
|
|
|
if (SYSTEM_ZLIB)
|
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
pkg_check_modules(ZLIB REQUIRED zlib)
|
|
|
|
list(APPEND DEPENDENCIES_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS})
|
|
|
|
list(APPEND DEPENDENCIES_COMPILE_OPTIONS ${ZLIB_CFLAGS_OTHER})
|
|
|
|
list(APPEND DEPENDENCIES_LIBRARIES ${ZLIB_LIBRARIES})
|
|
|
|
list(APPEND DEPENDENCIES_LIBRARY_DIRS ${ZLIB_LIBRARY_DIRS})
|
|
|
|
list(APPEND DEPENDENCIES_LINK_OPTIONS ${ZLIB_LDFLAGS_OTHER})
|
|
|
|
list(APPEND DEPENDENCIES_LEGACY_LDFLAGS ${ZLIB_LDFLAGS})
|
|
|
|
message(STATUS "Using system-installed zlib")
|
2022-01-18 02:56:12 -05:00
|
|
|
else()
|
2022-02-01 15:50:25 -05:00
|
|
|
set(BUILD_TESTING OFF CACHE BOOL "aaaaaa" FORCE)
|
|
|
|
set(BUILD_PROGRAMS OFF CACHE BOOL "aaa" FORCE)
|
|
|
|
set(BUILD_EXAMPLES OFF CACHE BOOL "a" FORCE)
|
|
|
|
set(ENABLE_EXTERNAL_LIBS OFF CACHE BOOL "come on" FORCE)
|
|
|
|
set(ENABLE_MPEG OFF CACHE BOOL "come on" FORCE)
|
|
|
|
add_subdirectory(extern/zlib EXCLUDE_FROM_ALL)
|
|
|
|
list(APPEND DEPENDENCIES_INCLUDE_DIRS extern/zlib ${CMAKE_CURRENT_BINARY_DIR}/extern/zlib)
|
|
|
|
list(APPEND DEPENDENCIES_LIBRARIES zlibstatic)
|
|
|
|
message(STATUS "Using vendored zlib")
|
2022-01-18 00:45:17 -05:00
|
|
|
endif()
|
|
|
|
|
2022-05-22 20:01:50 -04:00
|
|
|
if (USE_SDL2)
|
|
|
|
if (SYSTEM_SDL2)
|
|
|
|
if (PKG_CONFIG_FOUND)
|
|
|
|
pkg_check_modules(SDL2 sdl2>=${SYSTEM_SDL_MIN_VER})
|
|
|
|
if (SDL2_FOUND)
|
|
|
|
list(APPEND DEPENDENCIES_DEFINES HAVE_SDL2)
|
|
|
|
list(APPEND DEPENDENCIES_INCLUDE_DIRS ${SDL2_INCLUDE_DIRS})
|
|
|
|
list(APPEND DEPENDENCIES_COMPILE_OPTIONS ${SDL2_CFLAGS_OTHER})
|
|
|
|
list(APPEND DEPENDENCIES_LIBRARIES ${SDL2_LIBRARIES})
|
|
|
|
list(APPEND DEPENDENCIES_LIBRARY_DIRS ${SDL2_LIBRARY_DIRS})
|
|
|
|
list(APPEND DEPENDENCIES_LINK_OPTIONS ${SDL2_LDFLAGS_OTHER})
|
|
|
|
list(APPEND DEPENDENCIES_LEGACY_LDFLAGS ${SDL2_LDFLAGS})
|
|
|
|
endif()
|
2022-02-01 15:50:25 -05:00
|
|
|
endif()
|
2022-05-22 20:01:50 -04:00
|
|
|
if (NOT SDL2_FOUND)
|
|
|
|
find_package(SDL2 ${SYSTEM_SDL_MIN_VER} REQUIRED)
|
|
|
|
list(APPEND DEPENDENCIES_DEFINES HAVE_SDL2)
|
|
|
|
list(APPEND DEPENDENCIES_INCLUDE_DIRS ${SDL2_INCLUDE_DIR})
|
|
|
|
list(APPEND DEPENDENCIES_LIBRARIES ${SDL2_LIBRARY})
|
|
|
|
endif()
|
|
|
|
message(STATUS "Using system-installed SDL2")
|
2022-05-08 16:59:42 -04:00
|
|
|
else()
|
2022-05-27 16:51:57 -04:00
|
|
|
if (ANDROID AND NOT TERMUX)
|
2022-05-22 20:01:50 -04:00
|
|
|
set(SDL_SHARED ON CACHE BOOL "Force no dynamically-linked SDL" FORCE)
|
|
|
|
set(SDL_STATIC OFF CACHE BOOL "Force statically-linked SDL" FORCE)
|
|
|
|
else()
|
|
|
|
set(SDL_SHARED OFF CACHE BOOL "Force no dynamically-linked SDL" FORCE)
|
|
|
|
set(SDL_STATIC ON CACHE BOOL "Force statically-linked SDL" FORCE)
|
|
|
|
endif()
|
|
|
|
# https://github.com/libsdl-org/SDL/issues/1481
|
|
|
|
# On 2014-06-22 17:15:50 +0000, Sam Lantinga wrote:
|
|
|
|
# If you link SDL statically, you also need to define HAVE_LIBC so it builds with the C runtime that your application uses.
|
|
|
|
# This should probably go in a FAQ.
|
|
|
|
set(SDL_LIBC ON CACHE BOOL "Tell SDL that we want it to use our C runtime (required for proper static linking)" FORCE)
|
|
|
|
add_subdirectory(extern/SDL EXCLUDE_FROM_ALL)
|
|
|
|
list(APPEND DEPENDENCIES_DEFINES HAVE_SDL2)
|
|
|
|
list(APPEND DEPENDENCIES_INCLUDE_DIRS extern/SDL/include)
|
2022-05-27 16:51:57 -04:00
|
|
|
if (ANDROID AND NOT TERMUX)
|
2022-05-22 20:01:50 -04:00
|
|
|
list(APPEND DEPENDENCIES_LIBRARIES SDL2)
|
|
|
|
else()
|
|
|
|
list(APPEND DEPENDENCIES_LIBRARIES SDL2-static)
|
|
|
|
endif()
|
|
|
|
# Work around add_subdirectory'd SDL not propagating HAVE_LIBC to MSVC furnace build
|
|
|
|
if (MSVC)
|
|
|
|
list(APPEND DEPENDENCIES_COMPILE_OPTIONS "/DHAVE_LIBC")
|
|
|
|
endif()
|
|
|
|
message(STATUS "Using vendored SDL2")
|
2022-05-08 16:59:42 -04:00
|
|
|
endif()
|
2022-05-22 20:01:50 -04:00
|
|
|
else()
|
|
|
|
message(STATUS "Not using SDL2")
|
|
|
|
if (BUILD_GUI)
|
|
|
|
message(FATAL_ERROR "SDL2 is required in order to build with GUI! Disable BUILD_GUI otherwise.")
|
2022-04-09 08:33:13 -04:00
|
|
|
endif()
|
2021-05-11 16:08:08 -04:00
|
|
|
endif()
|
|
|
|
|
2022-02-01 15:50:25 -05:00
|
|
|
set(AUDIO_SOURCES
|
|
|
|
src/audio/abstract.cpp
|
2022-03-28 04:46:50 -04:00
|
|
|
src/audio/midi.cpp
|
2022-02-01 15:50:25 -05:00
|
|
|
)
|
|
|
|
|
2022-05-22 20:01:50 -04:00
|
|
|
if (USE_SDL2)
|
|
|
|
list(APPEND AUDIO_SOURCES src/audio/sdl.cpp)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (WITH_JACK)
|
2022-02-01 15:50:25 -05:00
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
pkg_check_modules(JACK REQUIRED jack)
|
2021-05-11 16:08:08 -04:00
|
|
|
list(APPEND AUDIO_SOURCES src/audio/jack.cpp)
|
2022-02-01 15:50:25 -05:00
|
|
|
list(APPEND DEPENDENCIES_INCLUDE_DIRS ${JACK_INCLUDE_DIRS})
|
|
|
|
list(APPEND DEPENDENCIES_DEFINES HAVE_JACK)
|
|
|
|
list(APPEND DEPENDENCIES_COMPILE_OPTIONS ${JACK_CFLAGS_OTHER})
|
|
|
|
list(APPEND DEPENDENCIES_LIBRARIES ${JACK_LIBRARIES})
|
|
|
|
list(APPEND DEPENDENCIES_LIBRARY_DIRS ${JACK_LIBRARY_DIRS})
|
|
|
|
list(APPEND DEPENDENCIES_LINK_OPTIONS ${JACK_LDFLAGS_OTHER})
|
|
|
|
list(APPEND DEPENDENCIES_LEGACY_LDFLAGS ${JACK_LDFLAGS})
|
|
|
|
message(STATUS "Building with JACK support")
|
|
|
|
else()
|
|
|
|
message(STATUS "Building without JACK support")
|
2021-05-11 16:08:08 -04:00
|
|
|
endif()
|
|
|
|
|
2022-02-21 13:47:49 -05:00
|
|
|
if (USE_RTMIDI)
|
|
|
|
list(APPEND AUDIO_SOURCES src/audio/rtmidi.cpp)
|
|
|
|
message(STATUS "Building with RtMidi")
|
2022-03-28 04:46:50 -04:00
|
|
|
list(APPEND DEPENDENCIES_DEFINES HAVE_RTMIDI)
|
2022-02-21 13:47:49 -05:00
|
|
|
else()
|
|
|
|
message(STATUS "Building without RtMidi")
|
|
|
|
endif()
|
|
|
|
|
2021-05-12 04:58:55 -04:00
|
|
|
set(ENGINE_SOURCES
|
|
|
|
src/log.cpp
|
2022-01-20 05:04:03 -05:00
|
|
|
src/fileutils.cpp
|
2022-01-25 18:46:27 -05:00
|
|
|
src/utfutils.cpp
|
2021-05-12 18:19:18 -04:00
|
|
|
|
2022-02-13 17:02:49 -05:00
|
|
|
extern/SAASound/src/SAAAmp.cpp
|
|
|
|
extern/SAASound/src/SAADevice.cpp
|
|
|
|
extern/SAASound/src/SAAEnv.cpp
|
|
|
|
extern/SAASound/src/SAAFreq.cpp
|
|
|
|
extern/SAASound/src/SAAImpl.cpp
|
|
|
|
extern/SAASound/src/SAANoise.cpp
|
|
|
|
extern/SAASound/src/SAASndC.cpp
|
|
|
|
extern/SAASound/src/SAASound.cpp
|
|
|
|
|
2022-02-24 03:57:45 -05:00
|
|
|
extern/adpcm/bs_codec.c
|
|
|
|
extern/adpcm/oki_codec.c
|
|
|
|
extern/adpcm/yma_codec.c
|
|
|
|
extern/adpcm/ymb_codec.c
|
|
|
|
extern/adpcm/ymz_codec.c
|
|
|
|
|
2021-05-12 18:19:18 -04:00
|
|
|
extern/Nuked-OPN2/ym3438.c
|
2022-05-26 19:46:20 -04:00
|
|
|
extern/Nuked-PSG/ympsg.c
|
2021-12-09 01:03:05 -05:00
|
|
|
extern/opm/opm.c
|
2022-02-25 04:26:01 -05:00
|
|
|
extern/Nuked-OPLL/opll.c
|
2022-05-04 19:06:32 -04:00
|
|
|
extern/opl/opl3.c
|
2021-05-14 04:23:40 -04:00
|
|
|
src/engine/platform/sound/sn76496.cpp
|
2022-01-13 02:52:19 -05:00
|
|
|
src/engine/platform/sound/ay8910.cpp
|
2022-01-14 16:29:27 -05:00
|
|
|
src/engine/platform/sound/saa1099.cpp
|
2022-05-20 03:43:39 -04:00
|
|
|
src/engine/platform/sound/namco.cpp
|
2021-05-22 22:10:25 -04:00
|
|
|
src/engine/platform/sound/gb/apu.c
|
2021-05-27 06:06:43 -04:00
|
|
|
src/engine/platform/sound/gb/timing.c
|
2021-06-06 15:02:38 -04:00
|
|
|
src/engine/platform/sound/pce_psg.cpp
|
2021-12-03 16:04:07 -05:00
|
|
|
src/engine/platform/sound/nes/apu.c
|
2022-04-03 23:37:16 -04:00
|
|
|
src/engine/platform/sound/nes/fds.c
|
2022-04-06 01:34:12 -04:00
|
|
|
src/engine/platform/sound/nes/mmc5.c
|
2022-03-10 15:51:27 -05:00
|
|
|
src/engine/platform/sound/vera_psg.c
|
|
|
|
src/engine/platform/sound/vera_pcm.c
|
2021-05-12 18:19:18 -04:00
|
|
|
|
2022-05-01 23:52:22 -04:00
|
|
|
src/engine/platform/sound/nes_nsfplay/nes_apu.cpp
|
|
|
|
src/engine/platform/sound/nes_nsfplay/nes_dmc.cpp
|
|
|
|
src/engine/platform/sound/nes_nsfplay/nes_fds.cpp
|
|
|
|
src/engine/platform/sound/nes_nsfplay/nes_mmc5.cpp
|
|
|
|
src/engine/platform/sound/nes_nsfplay/nes_n106.cpp
|
|
|
|
src/engine/platform/sound/nes_nsfplay/nes_vrc6.cpp
|
|
|
|
|
2021-12-04 02:42:22 -05:00
|
|
|
src/engine/platform/sound/c64/sid.cc
|
|
|
|
src/engine/platform/sound/c64/voice.cc
|
|
|
|
src/engine/platform/sound/c64/wave.cc
|
|
|
|
src/engine/platform/sound/c64/envelope.cc
|
|
|
|
src/engine/platform/sound/c64/filter.cc
|
|
|
|
src/engine/platform/sound/c64/extfilt.cc
|
|
|
|
src/engine/platform/sound/c64/pot.cc
|
|
|
|
src/engine/platform/sound/c64/version.cc
|
|
|
|
|
|
|
|
src/engine/platform/sound/c64/wave6581_PS_.cc
|
|
|
|
src/engine/platform/sound/c64/wave6581_PST.cc
|
|
|
|
src/engine/platform/sound/c64/wave6581_P_T.cc
|
|
|
|
src/engine/platform/sound/c64/wave6581__ST.cc
|
|
|
|
src/engine/platform/sound/c64/wave8580_PS_.cc
|
|
|
|
src/engine/platform/sound/c64/wave8580_PST.cc
|
|
|
|
src/engine/platform/sound/c64/wave8580_P_T.cc
|
|
|
|
src/engine/platform/sound/c64/wave8580__ST.cc
|
|
|
|
|
2022-01-14 03:37:36 -05:00
|
|
|
src/engine/platform/sound/tia/TIASnd.cpp
|
|
|
|
|
2021-12-15 01:23:58 -05:00
|
|
|
src/engine/platform/sound/ymfm/ymfm_adpcm.cpp
|
|
|
|
src/engine/platform/sound/ymfm/ymfm_opm.cpp
|
|
|
|
src/engine/platform/sound/ymfm/ymfm_opn.cpp
|
2022-02-09 23:19:02 -05:00
|
|
|
src/engine/platform/sound/ymfm/ymfm_opz.cpp
|
2021-12-15 01:23:58 -05:00
|
|
|
src/engine/platform/sound/ymfm/ymfm_ssg.cpp
|
2021-12-09 03:37:31 -05:00
|
|
|
|
2022-02-20 12:15:15 -05:00
|
|
|
src/engine/platform/sound/lynx/Mikey.cpp
|
|
|
|
|
2022-02-22 04:01:57 -05:00
|
|
|
src/engine/platform/sound/qsound.c
|
|
|
|
|
2022-03-08 11:00:09 -05:00
|
|
|
src/engine/platform/sound/x1_010/x1_010.cpp
|
|
|
|
|
2022-03-07 07:04:20 -05:00
|
|
|
src/engine/platform/sound/swan.cpp
|
2022-03-06 11:13:47 -05:00
|
|
|
|
2022-04-27 05:48:56 -04:00
|
|
|
src/engine/platform/sound/su.cpp
|
|
|
|
|
2022-03-14 06:22:12 -04:00
|
|
|
src/engine/platform/sound/k005289/k005289.cpp
|
|
|
|
|
2022-03-22 12:48:45 -04:00
|
|
|
src/engine/platform/sound/n163/n163.cpp
|
|
|
|
|
2022-03-22 03:48:48 -04:00
|
|
|
src/engine/platform/sound/vic20sound.c
|
|
|
|
|
2022-03-27 12:06:56 -04:00
|
|
|
src/engine/platform/sound/vrcvi/vrcvi.cpp
|
|
|
|
|
2022-05-10 00:18:25 -04:00
|
|
|
src/engine/platform/sound/scc/scc.cpp
|
|
|
|
|
2022-05-18 02:55:33 -04:00
|
|
|
src/engine/platform/sound/ymz280b.cpp
|
|
|
|
|
2022-05-20 14:45:26 -04:00
|
|
|
src/engine/platform/sound/rf5c68.cpp
|
|
|
|
|
2022-05-22 18:49:41 -04:00
|
|
|
src/engine/platform/sound/oki/okim6258.cpp
|
2022-05-22 19:06:56 -04:00
|
|
|
src/engine/platform/sound/oki/msm6295.cpp
|
2022-05-22 18:49:41 -04:00
|
|
|
|
2022-05-13 15:59:36 -04:00
|
|
|
src/engine/platform/oplAInterface.cpp
|
2022-05-13 03:52:43 -04:00
|
|
|
src/engine/platform/ym2608Interface.cpp
|
2021-12-09 13:25:02 -05:00
|
|
|
src/engine/platform/ym2610Interface.cpp
|
|
|
|
|
2021-05-12 04:58:55 -04:00
|
|
|
src/engine/blip_buf.c
|
|
|
|
src/engine/safeReader.cpp
|
2021-12-15 14:15:44 -05:00
|
|
|
src/engine/safeWriter.cpp
|
2022-02-18 13:11:04 -05:00
|
|
|
src/engine/config.cpp
|
2022-01-08 16:03:32 -05:00
|
|
|
src/engine/dispatchContainer.cpp
|
2021-05-12 04:58:55 -04:00
|
|
|
src/engine/engine.cpp
|
2022-02-18 12:39:45 -05:00
|
|
|
src/engine/fileOps.cpp
|
2022-04-03 03:15:04 -04:00
|
|
|
src/engine/fileOpsIns.cpp
|
2022-03-20 04:14:00 -04:00
|
|
|
src/engine/filter.cpp
|
2022-01-19 03:28:29 -05:00
|
|
|
src/engine/instrument.cpp
|
2021-05-15 17:42:48 -04:00
|
|
|
src/engine/macroInt.cpp
|
2021-12-09 01:44:40 -05:00
|
|
|
src/engine/pattern.cpp
|
2021-05-12 04:58:55 -04:00
|
|
|
src/engine/playback.cpp
|
2021-12-15 14:15:44 -05:00
|
|
|
src/engine/sample.cpp
|
|
|
|
src/engine/song.cpp
|
2022-02-18 13:04:33 -05:00
|
|
|
src/engine/sysDef.cpp
|
2022-01-19 05:10:06 -05:00
|
|
|
src/engine/wavetable.cpp
|
2022-04-07 16:46:48 -04:00
|
|
|
src/engine/waveSynth.cpp
|
2022-02-18 12:58:36 -05:00
|
|
|
src/engine/vgmOps.cpp
|
2021-05-12 04:58:55 -04:00
|
|
|
src/engine/platform/abstract.cpp
|
2021-05-12 18:19:18 -04:00
|
|
|
src/engine/platform/genesis.cpp
|
2021-05-16 18:43:10 -04:00
|
|
|
src/engine/platform/genesisext.cpp
|
2021-05-15 15:18:16 -04:00
|
|
|
src/engine/platform/sms.cpp
|
2022-02-25 04:26:01 -05:00
|
|
|
src/engine/platform/opll.cpp
|
2021-05-26 04:17:12 -04:00
|
|
|
src/engine/platform/gb.cpp
|
2021-06-06 15:02:38 -04:00
|
|
|
src/engine/platform/pce.cpp
|
2022-04-06 01:34:12 -04:00
|
|
|
src/engine/platform/mmc5.cpp
|
2021-12-04 01:19:54 -05:00
|
|
|
src/engine/platform/nes.cpp
|
2021-12-04 23:55:28 -05:00
|
|
|
src/engine/platform/c64.cpp
|
2021-12-08 17:40:35 -05:00
|
|
|
src/engine/platform/arcade.cpp
|
2022-04-06 23:56:06 -04:00
|
|
|
src/engine/platform/tx81z.cpp
|
2022-05-11 04:29:03 -04:00
|
|
|
src/engine/platform/ym2203.cpp
|
2022-05-14 19:19:07 -04:00
|
|
|
src/engine/platform/ym2203ext.cpp
|
2022-05-13 03:52:43 -04:00
|
|
|
src/engine/platform/ym2608.cpp
|
2022-05-18 23:49:21 -04:00
|
|
|
src/engine/platform/ym2608ext.cpp
|
2021-12-09 13:25:02 -05:00
|
|
|
src/engine/platform/ym2610.cpp
|
2021-12-14 14:31:57 -05:00
|
|
|
src/engine/platform/ym2610ext.cpp
|
2022-02-24 11:02:35 -05:00
|
|
|
src/engine/platform/ym2610b.cpp
|
|
|
|
src/engine/platform/ym2610bext.cpp
|
2022-01-13 02:52:19 -05:00
|
|
|
src/engine/platform/ay.cpp
|
2022-01-14 00:02:10 -05:00
|
|
|
src/engine/platform/ay8930.cpp
|
2022-03-05 18:18:08 -05:00
|
|
|
src/engine/platform/opl.cpp
|
2022-04-03 23:37:16 -04:00
|
|
|
src/engine/platform/fds.cpp
|
2022-01-14 03:37:36 -05:00
|
|
|
src/engine/platform/tia.cpp
|
2022-01-14 16:29:27 -05:00
|
|
|
src/engine/platform/saa.cpp
|
2022-01-15 17:28:33 -05:00
|
|
|
src/engine/platform/amiga.cpp
|
2022-05-23 20:01:10 -04:00
|
|
|
src/engine/platform/msm6258.cpp
|
2022-05-23 02:46:58 -04:00
|
|
|
src/engine/platform/msm6295.cpp
|
2022-03-04 18:18:43 -05:00
|
|
|
src/engine/platform/pcspkr.cpp
|
2022-02-23 02:52:30 -05:00
|
|
|
src/engine/platform/segapcm.cpp
|
2022-02-22 04:01:57 -05:00
|
|
|
src/engine/platform/qsound.cpp
|
2022-03-06 12:31:03 -05:00
|
|
|
src/engine/platform/x1_010.cpp
|
2022-02-20 12:15:15 -05:00
|
|
|
src/engine/platform/lynx.cpp
|
2022-04-27 05:48:56 -04:00
|
|
|
src/engine/platform/su.cpp
|
2022-03-07 07:04:20 -05:00
|
|
|
src/engine/platform/swan.cpp
|
2022-03-04 06:13:49 -05:00
|
|
|
src/engine/platform/vera.cpp
|
2022-05-14 01:22:23 -04:00
|
|
|
src/engine/platform/zxbeeper.cpp
|
2022-03-16 21:11:48 -04:00
|
|
|
src/engine/platform/bubsyswsg.cpp
|
2022-03-22 12:48:45 -04:00
|
|
|
src/engine/platform/n163.cpp
|
2022-03-21 10:02:51 -04:00
|
|
|
src/engine/platform/pet.cpp
|
2022-03-22 03:48:48 -04:00
|
|
|
src/engine/platform/vic20.cpp
|
2022-03-27 12:06:56 -04:00
|
|
|
src/engine/platform/vrc6.cpp
|
2022-05-10 00:18:25 -04:00
|
|
|
src/engine/platform/scc.cpp
|
2022-05-18 02:55:33 -04:00
|
|
|
src/engine/platform/ymz280b.cpp
|
2022-05-20 14:22:35 -04:00
|
|
|
src/engine/platform/namcowsg.cpp
|
2022-05-20 14:45:26 -04:00
|
|
|
src/engine/platform/rf5c68.cpp
|
2022-02-01 15:50:25 -05:00
|
|
|
src/engine/platform/dummy.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
if (WIN32)
|
|
|
|
list(APPEND ENGINE_SOURCES src/utfutils.cpp)
|
|
|
|
list(APPEND ENGINE_SOURCES src/engine/winStuff.cpp)
|
|
|
|
list(APPEND ENGINE_SOURCES res/furnace.rc)
|
|
|
|
endif()
|
2021-05-11 16:08:08 -04:00
|
|
|
|
2021-12-11 02:10:09 -05:00
|
|
|
set(GUI_SOURCES
|
2022-05-18 16:23:10 -04:00
|
|
|
extern/imgui_patched/imgui.cpp
|
|
|
|
extern/imgui_patched/imgui_draw.cpp
|
|
|
|
extern/imgui_patched/imgui_tables.cpp
|
|
|
|
extern/imgui_patched/imgui_widgets.cpp
|
|
|
|
extern/imgui_patched/backends/imgui_impl_sdlrenderer.cpp
|
|
|
|
extern/imgui_patched/backends/imgui_impl_sdl.cpp
|
|
|
|
extern/imgui_patched/misc/cpp/imgui_stdlib.cpp
|
2021-12-11 02:10:09 -05:00
|
|
|
extern/igfd/ImGuiFileDialog.cpp
|
|
|
|
|
2021-12-18 17:54:26 -05:00
|
|
|
src/gui/plot_nolerp.cpp
|
2022-01-19 16:58:01 -05:00
|
|
|
src/gui/font_exo.cpp
|
|
|
|
src/gui/font_liberationSans.cpp
|
|
|
|
src/gui/font_mononoki.cpp
|
|
|
|
src/gui/font_plexMono.cpp
|
|
|
|
src/gui/font_plexSans.cpp
|
|
|
|
src/gui/font_proggyClean.cpp
|
|
|
|
src/gui/font_ptMono.cpp
|
|
|
|
src/gui/font_unifont.cpp
|
2021-12-21 00:30:55 -05:00
|
|
|
src/gui/font_icon.cpp
|
2022-01-19 16:58:01 -05:00
|
|
|
src/gui/fonts.cpp
|
2022-01-27 00:29:16 -05:00
|
|
|
src/gui/debug.cpp
|
2022-03-13 19:32:35 -04:00
|
|
|
src/gui/fileDialog.cpp
|
2022-02-17 14:04:39 -05:00
|
|
|
|
2022-02-17 13:08:17 -05:00
|
|
|
src/gui/intConst.cpp
|
|
|
|
src/gui/guiConst.cpp
|
2022-02-17 14:04:39 -05:00
|
|
|
|
2022-03-21 18:34:43 -04:00
|
|
|
src/gui/about.cpp
|
|
|
|
src/gui/channels.cpp
|
2022-04-30 04:58:30 -04:00
|
|
|
src/gui/chanOsc.cpp
|
2022-03-21 18:34:43 -04:00
|
|
|
src/gui/compatFlags.cpp
|
|
|
|
src/gui/cursor.cpp
|
2022-03-21 17:34:19 -04:00
|
|
|
src/gui/dataList.cpp
|
2022-03-21 18:34:43 -04:00
|
|
|
src/gui/debugWindow.cpp
|
|
|
|
src/gui/doAction.cpp
|
|
|
|
src/gui/editing.cpp
|
|
|
|
src/gui/editControls.cpp
|
2022-04-19 19:44:05 -04:00
|
|
|
src/gui/effectList.cpp
|
2022-06-06 06:03:19 -04:00
|
|
|
src/gui/findReplace.cpp
|
2022-02-17 14:04:39 -05:00
|
|
|
src/gui/insEdit.cpp
|
2022-04-10 23:12:02 -04:00
|
|
|
src/gui/log.cpp
|
2022-03-21 18:34:43 -04:00
|
|
|
src/gui/mixer.cpp
|
2022-03-29 17:09:15 -04:00
|
|
|
src/gui/midiMap.cpp
|
2022-03-21 18:34:43 -04:00
|
|
|
src/gui/newSong.cpp
|
2022-02-17 22:40:23 -05:00
|
|
|
src/gui/orders.cpp
|
2022-03-21 18:34:43 -04:00
|
|
|
src/gui/osc.cpp
|
2022-02-17 14:04:39 -05:00
|
|
|
src/gui/pattern.cpp
|
2022-03-21 18:34:43 -04:00
|
|
|
src/gui/piano.cpp
|
|
|
|
src/gui/presets.cpp
|
|
|
|
src/gui/regView.cpp
|
2022-03-16 19:40:11 -04:00
|
|
|
src/gui/sampleEdit.cpp
|
2022-02-17 22:59:11 -05:00
|
|
|
src/gui/settings.cpp
|
2022-03-21 18:34:43 -04:00
|
|
|
src/gui/songInfo.cpp
|
|
|
|
src/gui/songNotes.cpp
|
|
|
|
src/gui/stats.cpp
|
2022-05-15 02:42:49 -04:00
|
|
|
src/gui/subSongs.cpp
|
2022-03-21 18:34:43 -04:00
|
|
|
src/gui/sysConf.cpp
|
2022-05-08 03:01:32 -04:00
|
|
|
src/gui/sysEx.cpp
|
2022-02-17 22:59:11 -05:00
|
|
|
src/gui/util.cpp
|
2022-03-21 17:34:19 -04:00
|
|
|
src/gui/waveEdit.cpp
|
2022-03-21 18:34:43 -04:00
|
|
|
src/gui/volMeter.cpp
|
2022-02-01 15:50:25 -05:00
|
|
|
src/gui/gui.cpp
|
|
|
|
)
|
2021-12-11 02:10:09 -05:00
|
|
|
|
2022-06-17 02:28:22 -04:00
|
|
|
if (WIN32 OR APPLE)
|
2022-06-19 01:11:18 -04:00
|
|
|
list(APPEND GUI_SOURCES extern/nfd-modified/src/nfd_common.cpp)
|
2022-06-17 02:28:22 -04:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if (WIN32)
|
|
|
|
list(APPEND GUI_SOURCES extern/nfd-modified/src/nfd_win.cpp)
|
|
|
|
endif()
|
|
|
|
|
2022-02-08 02:04:23 -05:00
|
|
|
if (APPLE)
|
|
|
|
list(APPEND GUI_SOURCES src/gui/macstuff.m)
|
2022-06-19 01:11:18 -04:00
|
|
|
list(APPEND GUI_SOURCES extern/nfd-modified/src/nfd_cocoa.mm)
|
2022-02-08 02:04:23 -05:00
|
|
|
endif()
|
|
|
|
|
2022-01-20 01:46:03 -05:00
|
|
|
if (NOT WIN32 AND NOT APPLE)
|
|
|
|
list(APPEND GUI_SOURCES src/gui/icon.c)
|
|
|
|
endif()
|
|
|
|
|
2022-01-20 02:59:14 -05:00
|
|
|
set(USED_SOURCES ${ENGINE_SOURCES} ${AUDIO_SOURCES} src/main.cpp)
|
|
|
|
|
2022-05-24 14:06:29 -04:00
|
|
|
if (USE_BACKWARD)
|
2022-05-29 01:44:21 -04:00
|
|
|
list(APPEND USED_SOURCES src/backtrace.cpp)
|
2022-05-24 14:17:40 -04:00
|
|
|
if (WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
2022-05-24 23:15:43 -04:00
|
|
|
list(APPEND DEPENDENCIES_LIBRARIES dbghelp psapi)
|
2022-05-24 14:17:40 -04:00
|
|
|
endif()
|
2022-05-29 00:12:22 -04:00
|
|
|
message(STATUS "Using backward-cpp")
|
|
|
|
else()
|
|
|
|
message(STATUS "Not using backward-cpp")
|
2022-05-24 14:06:29 -04:00
|
|
|
endif()
|
|
|
|
|
2021-12-11 02:10:09 -05:00
|
|
|
if (BUILD_GUI)
|
2022-01-20 02:59:14 -05:00
|
|
|
list(APPEND USED_SOURCES ${GUI_SOURCES})
|
2022-02-01 15:50:25 -05:00
|
|
|
list(APPEND DEPENDENCIES_INCLUDE_DIRS
|
2022-05-18 16:23:10 -04:00
|
|
|
extern/imgui_patched
|
2022-02-14 18:00:04 -05:00
|
|
|
extern/imgui_conf
|
2022-05-18 16:23:10 -04:00
|
|
|
extern/imgui_patched/backends
|
2022-02-01 15:50:25 -05:00
|
|
|
extern/IconFontCppHeaders
|
|
|
|
extern/igfd
|
|
|
|
)
|
2022-06-17 02:28:22 -04:00
|
|
|
if (WIN32 OR APPLE)
|
|
|
|
list(APPEND DEPENDENCIES_INCLUDE_DIRS
|
|
|
|
extern/nfd-modified/src/include
|
|
|
|
)
|
|
|
|
endif()
|
2022-02-01 15:50:25 -05:00
|
|
|
list(APPEND DEPENDENCIES_DEFINES HAVE_GUI)
|
|
|
|
message(STATUS "Building GUI")
|
2021-12-11 02:10:09 -05:00
|
|
|
else()
|
2022-02-01 15:50:25 -05:00
|
|
|
message(STATUS "Building headless")
|
2021-12-11 02:10:09 -05:00
|
|
|
endif()
|
2021-05-11 16:08:08 -04:00
|
|
|
|
2022-02-01 15:50:25 -05:00
|
|
|
if (WIN32)
|
2022-04-18 04:17:11 -04:00
|
|
|
list(APPEND DEPENDENCIES_LIBRARIES shlwapi)
|
2022-02-02 01:06:29 -05:00
|
|
|
if (NOT MSVC)
|
2022-04-18 04:17:11 -04:00
|
|
|
list(APPEND DEPENDENCIES_LIBRARIES -static)
|
2022-02-02 01:06:29 -05:00
|
|
|
endif()
|
2022-01-18 00:45:17 -05:00
|
|
|
endif()
|
|
|
|
|
2022-02-10 06:40:51 -05:00
|
|
|
if (APPLE)
|
|
|
|
find_library(COCOA Cocoa REQUIRED)
|
|
|
|
list(APPEND DEPENDENCIES_LIBRARIES ${COCOA})
|
|
|
|
endif()
|
|
|
|
|
2022-02-01 15:50:25 -05:00
|
|
|
if (NOT MSVC)
|
|
|
|
set(WARNING_FLAGS -Wall -Wextra -Wno-unused-parameter)
|
2022-03-13 23:21:01 -04:00
|
|
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
2022-06-20 05:55:28 -04:00
|
|
|
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0.0)
|
|
|
|
# nothing
|
|
|
|
else()
|
|
|
|
list(APPEND WARNING_FLAGS -Wno-cast-function-type)
|
|
|
|
endif()
|
2022-03-13 23:21:01 -04:00
|
|
|
endif()
|
2022-02-01 15:50:25 -05:00
|
|
|
if (WARNINGS_ARE_ERRORS)
|
|
|
|
list(APPEND WARNING_FLAGS -Werror)
|
|
|
|
endif()
|
|
|
|
else()
|
2022-03-31 12:50:09 -04:00
|
|
|
add_compile_options("/utf-8")
|
|
|
|
set(WARNING_FLAGS /W2 /D_CRT_SECURE_NO_WARNINGS)
|
2022-04-02 12:35:00 -04:00
|
|
|
list(APPEND WARNING_FLAGS
|
|
|
|
/wd4244 # implicit type conversions
|
|
|
|
/wd4305 # truncations
|
|
|
|
/wd4309 # truncations of constant values
|
|
|
|
)
|
2022-02-01 15:50:25 -05:00
|
|
|
if (WARNINGS_ARE_ERRORS)
|
|
|
|
list(APPEND WARNING_FLAGS /WX)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
# Nicer but cannot be narrowed down to just C++
|
|
|
|
# target_compile_options(furnace PRIVATE ${WARNING_FLAGS})
|
|
|
|
string(REPLACE ";" " " WARNING_FLAGS_STRING "${WARNING_FLAGS}")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS_STRING}")
|
|
|
|
if (WARNINGS_ARE_ERRORS)
|
|
|
|
message(WARNING
|
|
|
|
"Treating all warnings in furnace's C++ code as errors! "
|
|
|
|
"Please report any errors you encounter on the bug tracker."
|
|
|
|
)
|
|
|
|
endif()
|
2021-05-11 16:08:08 -04:00
|
|
|
|
2022-02-01 15:50:25 -05:00
|
|
|
if (MSVC)
|
|
|
|
add_executable(furnace WIN32 ${USED_SOURCES})
|
2022-05-27 16:51:57 -04:00
|
|
|
elseif(ANDROID AND NOT TERMUX)
|
2022-05-08 16:59:42 -04:00
|
|
|
add_library(furnace SHARED ${USED_SOURCES})
|
2022-02-01 15:50:25 -05:00
|
|
|
else()
|
|
|
|
add_executable(furnace ${USED_SOURCES})
|
2021-05-11 16:08:08 -04:00
|
|
|
endif()
|
|
|
|
|
2022-02-01 15:50:25 -05:00
|
|
|
target_include_directories(furnace SYSTEM PRIVATE ${DEPENDENCIES_INCLUDE_DIRS})
|
2022-02-14 18:00:04 -05:00
|
|
|
target_compile_definitions(furnace PRIVATE ${DEPENDENCIES_DEFINES} IMGUI_USER_CONFIG="imconfig_fur.h")
|
2022-02-01 15:50:25 -05:00
|
|
|
target_compile_options(furnace PRIVATE ${DEPENDENCIES_COMPILE_OPTIONS})
|
|
|
|
target_link_libraries(furnace PRIVATE ${DEPENDENCIES_LIBRARIES})
|
2022-02-20 17:58:12 -05:00
|
|
|
if (PKG_CONFIG_FOUND AND (SYSTEM_FMT OR SYSTEM_LIBSNDFILE OR SYSTEM_ZLIB OR SYSTEM_SDL2 OR SYSTEM_RTMIDI OR WITH_JACK))
|
2022-02-01 15:50:25 -05:00
|
|
|
if ("${CMAKE_VERSION}" VERSION_LESS "3.13")
|
|
|
|
message(WARNING
|
|
|
|
"CMake version is <3.13, using old pkg-config LDFLAGS. "
|
|
|
|
"You may encounter linking problems with these!"
|
|
|
|
)
|
|
|
|
target_link_libraries(furnace PRIVATE ${DEPENDENCIES_LEGACY_LDFLAGS})
|
|
|
|
else()
|
|
|
|
target_link_directories(furnace PRIVATE ${DEPENDENCIES_LIBRARY_DIRS})
|
|
|
|
target_link_options(furnace PRIVATE ${DEPENDENCIES_LINK_OPTIONS})
|
2022-01-20 02:59:14 -05:00
|
|
|
endif()
|
2021-05-11 16:08:08 -04:00
|
|
|
endif()
|
2021-12-24 18:12:36 -05:00
|
|
|
|
2022-05-27 16:51:57 -04:00
|
|
|
if (NOT ANDROID OR TERMUX)
|
2022-05-08 16:59:42 -04:00
|
|
|
install(TARGETS furnace RUNTIME DESTINATION bin)
|
|
|
|
|
|
|
|
if (NOT WIN32 AND NOT APPLE)
|
|
|
|
include(GNUInstallDirs)
|
|
|
|
install(FILES res/furnace.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
|
|
|
|
install(FILES res/furnace.appdata.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo)
|
|
|
|
install(DIRECTORY papers DESTINATION ${CMAKE_INSTALL_DOCDIR})
|
|
|
|
install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_DATADIR}/licenses/furnace)
|
|
|
|
install(DIRECTORY demos DESTINATION ${CMAKE_INSTALL_DATADIR}/furnace)
|
2022-06-06 19:18:45 -04:00
|
|
|
install(DIRECTORY instruments DESTINATION ${CMAKE_INSTALL_DATADIR}/furnace)
|
2022-05-16 13:16:55 -04:00
|
|
|
foreach(num 16 32 64 128 256 512)
|
|
|
|
set(res ${num}x${num})
|
|
|
|
install(FILES res/icon.iconset/icon_${res}.png RENAME furnace.png DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/${res}/apps)
|
2022-05-16 13:25:15 -04:00
|
|
|
install(FILES res/icon.iconset/icon_${res}@2x.png RENAME furnace.png DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/${res}@2/apps)
|
2022-05-16 13:16:55 -04:00
|
|
|
endforeach()
|
2022-05-08 16:59:42 -04:00
|
|
|
install(FILES res/logo.png RENAME furnace.png DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/1024x1024/apps)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(CPACK_PACKAGE_NAME "Furnace")
|
|
|
|
set(CPACK_PACKAGE_VENDOR "tildearrow")
|
|
|
|
set(CPACK_PACKAGE_DESCRIPTION "free and open-source chiptune tracker")
|
|
|
|
|
|
|
|
if (APPLE)
|
|
|
|
set(CPACK_GENERATOR Bundle)
|
|
|
|
set(CPACK_DMG_SLA_DIR ${CMAKE_SOURCE_DIR}/res/macLicense)
|
|
|
|
set(CPACK_DMG_SLA_LANGUAGES en)
|
|
|
|
set(CPACK_BUNDLE_NAME "Furnace")
|
|
|
|
set(CPACK_DMG_VOLUME_NAME "Furnace")
|
|
|
|
set(CPACK_BUNDLE_PLIST ${CMAKE_SOURCE_DIR}/res/Info.plist)
|
|
|
|
set(CPACK_BUNDLE_ICON ${CMAKE_SOURCE_DIR}/res/icon.icns)
|
|
|
|
set(CPACK_BUNDLE_STARTUP_COMMAND "furnace")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
include(CPack)
|
2021-12-24 18:12:36 -05:00
|
|
|
endif()
|