From 6852bd76e28ebfb4f48d00968c05658e8ff8dd0b Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Tue, 23 Feb 2021 00:38:44 +0100 Subject: [PATCH] Add option SFIZZ_USE_SYSTEM_ABSEIL --- CMakeLists.txt | 4 +--- cmake/SfizzDeps.cmake | 7 +++++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f01465d7..36341f05 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,6 +34,7 @@ option_ex (SFIZZ_DEVTOOLS "Enable developer tools build" OFF) option_ex (SFIZZ_SHARED "Enable shared library build" ON) option_ex (SFIZZ_USE_SNDFILE "Enable use of the sndfile library" ON) option_ex (SFIZZ_USE_VCPKG "Assume that sfizz is build using vcpkg" OFF) +option_ex (SFIZZ_USE_SYSTEM_ABSEIL "Use Abseil libraries preinstalled on system" OFF) option_ex (SFIZZ_STATIC_DEPENDENCIES "Link dependencies statically" OFF) option_ex (SFIZZ_RELEASE_ASSERTS "Forced assertions in release builds" OFF) @@ -46,9 +47,6 @@ include (CheckIPO) # Dylib bunder for macOS include (BundleDylibs) -# Add Abseil -add_subdirectory (external/abseil-cpp EXCLUDE_FROM_ALL) - # Add the static library targets and sources add_subdirectory (src) diff --git a/cmake/SfizzDeps.cmake b/cmake/SfizzDeps.cmake index 464d6186..128c43eb 100644 --- a/cmake/SfizzDeps.cmake +++ b/cmake/SfizzDeps.cmake @@ -35,6 +35,13 @@ if(APPLE) list(APPEND CMAKE_PREFIX_PATH /usr/local) endif() +# Add Abseil +if(SFIZZ_USE_SYSTEM_ABSEIL) + find_package(absl REQUIRED) +else() + add_subdirectory("external/abseil-cpp" EXCLUDE_FROM_ALL) +endif() + # The jsl utility library for C++ add_library(sfizz_jsl INTERFACE) add_library(sfizz::jsl ALIAS sfizz_jsl)