diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 9fbac54b..22426d44 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -27,7 +27,7 @@ jobs: - name: Configure CMake # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type - run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=/usr -DWIVRN_BUILD_CLIENT=OFF -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DWIVRN_USE_VAAPI=ON -DWIVRN_USE_X264=ON -DWIVRN_USE_NVENC=ON + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=/usr -DWIVRN_BUILD_CLIENT=OFF -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DWIVRN_USE_VAAPI=ON -DWIVRN_USE_X264=ON -DWIVRN_USE_NVENC=ON -DWIVRN_USE_SYSTEM_BOOST=OFF - name: Package build dependencies # For easier packaging, build dependencies are made available as a separate archive diff --git a/CMakeLists.txt b/CMakeLists.txt index d848a470..7c50cb29 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,6 +17,7 @@ include(ExternalProject) include("cmake/AutoOption.cmake") option(WIVRN_USE_SYSTEM_FREETYPE "Use system FreeType" ON) +auto_option(WIVRN_USE_SYSTEM_BOOST "Use system Boost headers" AUTO) auto_option(WIVRN_USE_SYSTEMD "Use libsystemd, required to show pretty hostname" AUTO) option(WIVRN_USE_ANDROID_VALIDATION_LAYER "Download the android version of the Vulkan validation layer" OFF) option(WIVRN_BUILD_CLIENT "Build WiVRn client" ON) @@ -39,6 +40,12 @@ endif() find_package(PkgConfig REQUIRED) find_package(Vulkan REQUIRED) +if (WIVRN_USE_SYSTEM_BOOST STREQUAL "AUTO") + find_package(Boost 1.75.0) +elseif(WIVRN_USE_SYSTEM_BOOST STREQUAL "ON") + find_package(Boost 1.75.0 REQUIRED) +endif() + if (WIVRN_BUILD_SERVER) if (NOT WIVRN_USE_NVENC AND NOT WIVRN_USE_VAAPI AND NOT WIVRN_USE_X264) message(FATAL_ERROR "No encoder selected, use at least one of WIVRN_USE_NVENC, WIVRN_USE_VAAPI or WIVRN_USE_X264") diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index e2f7d3b6..d7592513 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -1,5 +1,8 @@ - -FetchContent_MakeAvailable(boostpfr) +if (BOOST_FOUND) + add_library(Boost::pfr ALIAS Boost::headers) +else() + FetchContent_MakeAvailable(boostpfr) +endif() if (GIT_DESC) configure_file(version.cpp.in version.cpp) diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt index 2cb47452..023a17ce 100644 --- a/server/CMakeLists.txt +++ b/server/CMakeLists.txt @@ -124,7 +124,6 @@ target_link_libraries( xrt-external-openxr xrt-interfaces - Boost::pfr PkgConfig::AVAHI PkgConfig::libpulse Eigen3::Eigen