devendor libraries
This commit is contained in:
parent
345962092e
commit
4419f72218
|
@ -13,8 +13,13 @@ else()
|
|||
set(BUILD_GUI ON)
|
||||
endif()
|
||||
|
||||
add_subdirectory(extern/fmt)
|
||||
option(DEVENDOR_LIBRARIES "Use local versions of dependencies instead of the ones provided by submodules" OFF)
|
||||
|
||||
if (NOT DEVENDOR_LIBRARIES)
|
||||
add_subdirectory(extern/fmt)
|
||||
endif()
|
||||
|
||||
if (NOT DEVENDOR_LIBRARIES)
|
||||
set(BUILD_TESTING OFF CACHE BOOL "aaaaaa" FORCE)
|
||||
set(BUILD_PROGRAMS OFF CACHE BOOL "aaa" FORCE)
|
||||
set(BUILD_EXAMPLES OFF CACHE BOOL "a" FORCE)
|
||||
|
@ -24,7 +29,14 @@ add_subdirectory(extern/libsndfile)
|
|||
add_subdirectory(extern/zlib)
|
||||
|
||||
include_directories(extern/zlib ${CMAKE_CURRENT_BINARY_DIR}/extern/zlib)
|
||||
endif()
|
||||
|
||||
if (DEVENDOR_LIBRARIES)
|
||||
find_package(SDL REQUIRED)
|
||||
set(HAVE_SDL2 ${SDL_LIBRARY})
|
||||
include_directories(extern/imgui extern/IconFontCppHeaders extern/imgui/backends extern/igfd ${SDL_INCLUDE_DIR})
|
||||
find_library(HAVE_JACK jack)
|
||||
else()
|
||||
if (WIN32)
|
||||
set(SDL_SHARED OFF)
|
||||
set(SDL_STATIC ON)
|
||||
|
@ -47,6 +59,7 @@ else()
|
|||
find_library(HAVE_SNDFILE sndfile)
|
||||
set(HAVE_Z zlibstatic)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(AUDIO_SOURCES src/audio/abstract.cpp)
|
||||
if (HAVE_SDL2)
|
||||
|
@ -154,6 +167,10 @@ else()
|
|||
add_executable(furnace ${ENGINE_SOURCES} ${AUDIO_SOURCES} src/main.cpp)
|
||||
endif()
|
||||
|
||||
if (DEVENDOR_LIBRARIES)
|
||||
target_compile_definitions(furnace PUBLIC DEVENDOR_LIBRARIES)
|
||||
endif()
|
||||
|
||||
target_link_libraries(furnace ${HAVE_SDL2} ${HAVE_Z} sndfile fmt)
|
||||
|
||||
if (HAVE_JACK)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include "taAudio.h"
|
||||
#if defined(_WIN32) || defined(HAVE_GUI)
|
||||
#if (defined(_WIN32) || defined(HAVE_GUI)) && !defined(DEVENDOR_LIBRARIES)
|
||||
#include <SDL.h>
|
||||
#else
|
||||
#include <SDL2/SDL.h>
|
||||
|
|
Loading…
Reference in New Issue