Remove all AUTO options in cmake
This commit is contained in:
@@ -199,6 +199,7 @@ jobs:
|
||||
cmake -B ${{github.workspace}}/build
|
||||
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
|
||||
-DCMAKE_INSTALL_PREFIX=/usr
|
||||
-DWIVRN_USE_SYSTEM_OPENXR=OFF
|
||||
--preset everything
|
||||
-DWIVRN_BUILD_DASHBOARD=OFF
|
||||
-DWIVRN_BUILD_DISSECTOR=OFF
|
||||
@@ -307,6 +308,7 @@ jobs:
|
||||
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
|
||||
-DCMAKE_INSTALL_PREFIX=/usr
|
||||
--preset ${{ matrix.cmake_preset }}
|
||||
-DWIVRN_USE_SYSTEM_OPENXR=OFF
|
||||
|
||||
- name: Build
|
||||
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
|
||||
|
||||
+27
-84
@@ -17,13 +17,12 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
include(FetchContent)
|
||||
include(ExternalProject)
|
||||
include(GNUInstallDirs)
|
||||
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_SYSTEM_OPENXR "Use system OpenXR headers" AUTO)
|
||||
auto_option(WIVRN_USE_SYSTEMD "Use libsystemd" AUTO)
|
||||
auto_option(WIVRN_USE_LIBKTX "Use libktx" AUTO)
|
||||
option(WIVRN_USE_SYSTEM_BOOST "Use system Boost headers" ON)
|
||||
option(WIVRN_USE_SYSTEM_OPENXR "Use system OpenXR headers" ON)
|
||||
option(WIVRN_USE_SYSTEMD "Use libsystemd" ON)
|
||||
option(WIVRN_USE_LIBKTX "Use libktx" ${ANDROID})
|
||||
option(WIVRN_USE_ANDROID_VALIDATION_LAYER "Download the android version of the Vulkan validation layer" OFF)
|
||||
option(WIVRN_BUILD_CLIENT "Build WiVRn client" OFF)
|
||||
option(WIVRN_BUILD_SERVER "Build WiVRn server" ON)
|
||||
@@ -35,12 +34,12 @@ option(WIVRN_BUILD_TEST "Build test binaries" OFF)
|
||||
option(WIVRN_WERROR "Treat warnings as errors" OFF)
|
||||
|
||||
option(WIVRN_USE_NVENC "Enable nvenc (Nvidia) hardware encoder" ON)
|
||||
auto_option(WIVRN_USE_VAAPI "Enable vaapi (AMD/Intel) hardware encoder" AUTO)
|
||||
auto_option(WIVRN_USE_VULKAN_ENCODE "Enable vulkan video encoder" AUTO)
|
||||
auto_option(WIVRN_USE_X264 "Enable x264 software encoder" AUTO)
|
||||
option(WIVRN_USE_VAAPI "Enable vaapi (AMD/Intel) hardware encoder" ON)
|
||||
option(WIVRN_USE_VULKAN_ENCODE "Enable vulkan video encoder" ON)
|
||||
option(WIVRN_USE_X264 "Enable x264 software encoder" ON)
|
||||
|
||||
auto_option(WIVRN_USE_PIPEWIRE "Enable pipewire backend" AUTO)
|
||||
auto_option(WIVRN_USE_PULSEAUDIO "Enable pulseaudio backend" AUTO)
|
||||
option(WIVRN_USE_PIPEWIRE "Enable pipewire backend" ON)
|
||||
option(WIVRN_USE_PULSEAUDIO "Enable pulseaudio backend" OFF)
|
||||
|
||||
set(OVR_COMPAT_SEARCH_PATH "/opt/xrizer:/usr/local/lib/OpenComposite:/usr/lib/OpenComposite:/opt/OpenComposite:/opt/opencomposite"
|
||||
CACHE STRING "List of places to search for the OpenVR compatibility layer, separated by :")
|
||||
@@ -64,6 +63,12 @@ endif()
|
||||
|
||||
option(ENABLE_COLOURED_OUTPUT "Always produce ANSI-coloured output (GNU/Clang only)." ON)
|
||||
|
||||
if (WIVRN_BUILD_CLIENT OR WIVRN_BUILD_SERVER OR WIVRN_BUILD_DASHBOARD OR WIVRN_BUILD_DISSECTOR)
|
||||
set(NEED_COMMON TRUE)
|
||||
else()
|
||||
set(NEED_COMMON FALSE)
|
||||
endif()
|
||||
|
||||
if(ENABLE_COLOURED_OUTPUT)
|
||||
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
add_compile_options(-fdiagnostics-color=always)
|
||||
@@ -75,19 +80,13 @@ endif()
|
||||
find_package(PkgConfig REQUIRED)
|
||||
find_package(Vulkan REQUIRED)
|
||||
find_package(Git)
|
||||
if (NOT ANDROID)
|
||||
if (NEED_COMMON AND NOT ANDROID)
|
||||
find_package(OpenSSL REQUIRED)
|
||||
endif()
|
||||
include(VulkanVersion)
|
||||
|
||||
if (WIVRN_USE_SYSTEM_BOOST STREQUAL "AUTO")
|
||||
if(WIVRN_BUILD_DISSECTOR)
|
||||
find_package(Boost 1.84.0 COMPONENTS locale url)
|
||||
else()
|
||||
find_package(Boost 1.75.0 COMPONENTS locale url)
|
||||
endif()
|
||||
elseif(WIVRN_USE_SYSTEM_BOOST STREQUAL "ON")
|
||||
if(WIVRN_BUILD_DISSECTOR)
|
||||
if (WIVRN_USE_SYSTEM_BOOST AND NEED_COMMON)
|
||||
if (WIVRN_BUILD_DISSECTOR)
|
||||
find_package(Boost 1.84.0 REQUIRED COMPONENTS locale url)
|
||||
else()
|
||||
find_package(Boost 1.75.0 REQUIRED COMPONENTS locale url)
|
||||
@@ -104,72 +103,30 @@ if (WIVRN_BUILD_SERVER)
|
||||
message(FATAL_ERROR "No encoder selected, use at least one of WIVRN_USE_NVENC, WIVRN_USE_VAAPI, WIVRN_USE_VULKAN_ENCODE or WIVRN_USE_X264")
|
||||
endif()
|
||||
|
||||
if (WIVRN_USE_VAAPI STREQUAL "AUTO")
|
||||
pkg_check_modules(LIBAV IMPORTED_TARGET libavcodec libavutil libswscale libavfilter)
|
||||
pkg_check_modules(LIBDRM IMPORTED_TARGET libdrm)
|
||||
if (LIBAV_FOUND AND LIBDRM_FOUND)
|
||||
set(WIVRN_USE_VAAPI ON)
|
||||
else()
|
||||
set(WIVRN_USE_VAAPI OFF)
|
||||
endif()
|
||||
elseif (WIVRN_USE_VAAPI)
|
||||
if (WIVRN_USE_VAAPI)
|
||||
pkg_check_modules(LIBAV REQUIRED IMPORTED_TARGET libavcodec libavutil libswscale libavfilter)
|
||||
pkg_check_modules(LIBDRM REQUIRED IMPORTED_TARGET libdrm)
|
||||
endif()
|
||||
|
||||
if (WIVRN_USE_VULKAN_ENCODE STREQUAL "AUTO")
|
||||
if (Vulkan_VERSION VERSION_GREATER_EQUAL 1.3.283)
|
||||
set(WIVRN_USE_VULKAN_ENCODE ON)
|
||||
else()
|
||||
set(WIVRN_USE_VULKAN_ENCODE OFF)
|
||||
endif()
|
||||
elseif(WIVRN_USE_VULKAN_ENCODE)
|
||||
if (WIVRN_USE_VULKAN_ENCODE)
|
||||
if (Vulkan_VERSION VERSION_LESS 1.3.283)
|
||||
message(FATAL_ERROR "Vulkan video encode requires 1.3.283, found ${Vulkan_VERSION}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (WIVRN_USE_X264 STREQUAL "AUTO")
|
||||
pkg_check_modules(X264 IMPORTED_TARGET x264)
|
||||
if (X264_FOUND)
|
||||
set(WIVRN_USE_X264 ON)
|
||||
else()
|
||||
set(WIVRN_USE_X264 OFF)
|
||||
endif()
|
||||
elseif (WIVRN_USE_X264)
|
||||
if (WIVRN_USE_X264)
|
||||
pkg_check_modules(X264 REQUIRED IMPORTED_TARGET x264)
|
||||
endif()
|
||||
|
||||
if (WIVRN_USE_SYSTEMD STREQUAL "AUTO")
|
||||
pkg_check_modules(SYSTEMD IMPORTED_TARGET libsystemd)
|
||||
if (SYSTEMD_FOUND)
|
||||
set(WIVRN_USE_SYSTEMD ON)
|
||||
else()
|
||||
set(WIVRN_USE_SYSTEMD OFF)
|
||||
endif()
|
||||
elseif (WIVRN_USE_SYSTEMD)
|
||||
if (WIVRN_USE_SYSTEMD)
|
||||
pkg_check_modules(SYSTEMD REQUIRED IMPORTED_TARGET libsystemd)
|
||||
endif()
|
||||
|
||||
if (WIVRN_USE_PIPEWIRE STREQUAL "AUTO")
|
||||
pkg_check_modules(libpipewire IMPORTED_TARGET libpipewire-0.3)
|
||||
if (libpipewire_FOUND)
|
||||
set(WIVRN_USE_PIPEWIRE ON)
|
||||
else()
|
||||
set(WIVRN_USE_PIPEWIRE OFF)
|
||||
endif()
|
||||
elseif (WIVRN_USE_PIPEWIRE)
|
||||
if (WIVRN_USE_PIPEWIRE)
|
||||
pkg_check_modules(libpipewire REQUIRED IMPORTED_TARGET libpipewire-0.3)
|
||||
endif()
|
||||
|
||||
if (WIVRN_USE_PULSEAUDIO STREQUAL "AUTO")
|
||||
pkg_check_modules(libpulse IMPORTED_TARGET libpulse)
|
||||
if (libpulse_FOUND)
|
||||
set(WIVRN_USE_PULSEAUDIO ON)
|
||||
else()
|
||||
set(WIVRN_USE_PULSEAUDIO OFF)
|
||||
endif()
|
||||
elseif (WIVRN_USE_PULSEAUDIO)
|
||||
if (WIVRN_USE_PULSEAUDIO)
|
||||
pkg_check_modules(libpulse REQUIRED IMPORTED_TARGET libpulse)
|
||||
endif()
|
||||
|
||||
@@ -215,23 +172,11 @@ if (WIVRN_BUILD_CLIENT OR WIVRN_BUILD_DASHBOARD)
|
||||
find_package(Gettext REQUIRED)
|
||||
endif()
|
||||
|
||||
if (WIVRN_BUILD_CLIENT)
|
||||
if (WIVRN_USE_LIBKTX STREQUAL "AUTO")
|
||||
if (ANDROID)
|
||||
set(WIVRN_USE_LIBKTX ON)
|
||||
else()
|
||||
set(WIVRN_USE_LIBKTX OFF)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (WIVRN_BUILD_CLIENT AND NOT ANDROID)
|
||||
pkg_check_modules(LIBAV REQUIRED IMPORTED_TARGET libavcodec libavutil libswscale libavfilter)
|
||||
find_package(Fontconfig REQUIRED)
|
||||
|
||||
if (WIVRN_USE_SYSTEM_OPENXR STREQUAL "AUTO")
|
||||
find_package(OpenXR 1.1.48)
|
||||
elseif(WIVRN_USE_SYSTEM_OPENXR STREQUAL "ON")
|
||||
if (WIVRN_USE_SYSTEM_OPENXR)
|
||||
find_package(OpenXR 1.1.48 REQUIRED)
|
||||
endif()
|
||||
|
||||
@@ -245,9 +190,7 @@ if(ANDROID)
|
||||
endif()
|
||||
|
||||
if (WIVRN_BUILD_DISSECTOR)
|
||||
if (WIVRN_USE_SYSTEM_OPENXR STREQUAL "AUTO")
|
||||
find_package(OpenXR 1.1.48)
|
||||
elseif(WIVRN_USE_SYSTEM_OPENXR STREQUAL "ON")
|
||||
if (WIVRN_USE_SYSTEM_OPENXR)
|
||||
find_package(OpenXR 1.1.48 REQUIRED)
|
||||
endif()
|
||||
find_package(Wireshark REQUIRED)
|
||||
@@ -305,7 +248,7 @@ FetchContent_Declare(monado
|
||||
)
|
||||
|
||||
add_subdirectory(external)
|
||||
if (WIVRN_BUILD_CLIENT OR WIVRN_BUILD_SERVER OR WIVRN_BUILD_DASHBOARD OR WIVRN_BUILD_DISSECTOR)
|
||||
if (NEED_COMMON)
|
||||
add_subdirectory(common)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -83,6 +83,7 @@ android {
|
||||
'-DCMAKE_ANDROID_NDK_VERSION=' + ndkVersion,
|
||||
'-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON',
|
||||
'-DCMAKE_EXPORT_COMPILE_COMMANDS=ON',
|
||||
'-DWIVRN_USE_SYSTEM_BOOST=OFF',
|
||||
'-DWIVRN_USE_SYSTEM_FREETYPE=OFF',
|
||||
'-DWIVRN_BUILD_CLIENT=ON',
|
||||
'-DWIVRN_BUILD_SERVER=OFF',
|
||||
|
||||
@@ -13,7 +13,7 @@ if (WIVRN_USE_LIBKTX)
|
||||
FetchContent_MakeAvailable(libktx)
|
||||
endif()
|
||||
|
||||
if (NOT BOOST_FOUND)
|
||||
if (NOT WIVRN_USE_SYSTEM_BOOST)
|
||||
FetchContent_MakeAvailable(boost)
|
||||
endif()
|
||||
|
||||
@@ -51,7 +51,7 @@ if(ANDROID)
|
||||
else()
|
||||
add_executable(wivrn)
|
||||
|
||||
if (OpenXR_FOUND)
|
||||
if (WIVRN_USE_SYSTEM_OPENXR)
|
||||
target_link_libraries(wivrn OpenXR::openxr_loader OpenXR::headers)
|
||||
else()
|
||||
FetchContent_MakeAvailable(openxr_loader)
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
function(auto_option name description default)
|
||||
set(${name} ${default} CACHE STRING "${description}")
|
||||
set_property(CACHE ${name} PROPERTY STRINGS AUTO ON OFF)
|
||||
endfunction()
|
||||
@@ -1,4 +1,4 @@
|
||||
if (BOOST_FOUND)
|
||||
if (WIVRN_USE_SYSTEM_BOOST)
|
||||
add_library(Boost::pfr ALIAS Boost::headers)
|
||||
elseif (WIVRN_BUILD_CLIENT)
|
||||
FetchContent_MakeAvailable(boost)
|
||||
|
||||
@@ -352,10 +352,6 @@ modules:
|
||||
- WIVRN_SRC1
|
||||
WIVRN_SRC2
|
||||
WIVRN_SRC3
|
||||
- type: archive
|
||||
url: BOOSTPFR_URL
|
||||
dest: deps/boostpfr-src
|
||||
sha256: BOOSTPFR_SHA256
|
||||
- type: git
|
||||
url: https://gitlab.freedesktop.org/monado/monado
|
||||
tag: MONADO_COMMIT
|
||||
@@ -363,7 +359,6 @@ modules:
|
||||
- type: shell
|
||||
commands:
|
||||
- cd deps/monado-src && ../../patches/apply.sh ../../patches/monado/*
|
||||
- cd deps/boostpfr-src && ../../patches/apply.sh ../../flatpak/boostpfr-gcc-12-internal-compiler-error.patch
|
||||
|
||||
- name: wivrn
|
||||
buildsystem: cmake-ninja
|
||||
@@ -378,6 +373,8 @@ modules:
|
||||
- -DWIVRN_USE_NVENC=ON
|
||||
- -DWIVRN_USE_VULKAN_ENCODE=ON
|
||||
- -DWIVRN_USE_PULSEAUDIO=OFF
|
||||
- -DWIVRN_USE_PIPEWIRE=ON
|
||||
- -DWIVRN_USE_SYSTEM_BOOST=OFF
|
||||
- -DWIVRN_WERROR=ON
|
||||
- -DWIVRN_CHECK_CAPSYSNICE=OFF # Capabilities don't work inside flatpak
|
||||
- -DFETCHCONTENT_FULLY_DISCONNECTED=ON
|
||||
|
||||
@@ -11,7 +11,7 @@ set_target_properties(wivrn-dissector PROPERTIES
|
||||
target_link_libraries(wivrn-dissector PRIVATE epan wivrn-common)
|
||||
set_target_properties(wivrn-dissector PROPERTIES CXX_VISIBILITY_PRESET hidden)
|
||||
|
||||
if (OpenXR_FOUND)
|
||||
if (WIVRN_USE_SYSTEM_OPENXR)
|
||||
target_link_libraries(wivrn-dissector PRIVATE OpenXR::headers)
|
||||
else()
|
||||
FetchContent_MakeAvailable(openxr_loader)
|
||||
|
||||
Reference in New Issue
Block a user