feat(bindless): Adjust build scripts

This commit is contained in:
PancakeTAS 2026-04-25 19:39:37 +02:00
parent 218820e8dc
commit 3211d8f9e8
No known key found for this signature in database
5 changed files with 23 additions and 37 deletions

View file

@ -6,14 +6,14 @@ include(GNUInstallDirs)
option(LSFGVK_BUILD_VK_LAYER "Build the Vulkan layer" ON)
option(LSFGVK_BUILD_UI "Build the user interface" OFF)
option(LSFGVK_BUILD_CLI "Build the command line interface" ON)
option(LSFGVK_INSTALL_DEVELOP "Install development libraries and headers" OFF)
option(LSFGVK_INSTALL_LIBRARIES "Install development libraries and headers" OFF)
option(LSFGVK_INSTALL_XDG_FILES "Install the application icon and desktop files" OFF)
set(LSFGVK_LAYER_LIBRARY_PATH liblsfg-vk-layer.so CACHE STRING "Change where Vulkan searches for the layer library")
option(LSFGVK_TESTING_RENDERDOC "Enable RenderDoc integration for testing purposes" OFF)
# === READ HERE FOR BUILD OPTIONS ===
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_SKIP_RPATH ON)
@ -35,18 +35,13 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
-Wno-switch-default
# Then there's code-style things I don't care about
-Wno-missing-designated-field-initializers
-Wno-shadow
-Wno-unused-macros
# And functional warning I don't care about either
-Wno-cast-function-type-strict
-Wno-padded
)
endif()
endif()
if(LSFGVK_TESTING_RENDERDOC)
add_compile_definitions(LSFGVK_TESTING_RENDERDOC)
endif()
add_subdirectory(lsfg-vk-common)
add_subdirectory(lsfg-vk-backend)
if(LSFGVK_BUILD_VK_LAYER)

View file

@ -76,7 +76,7 @@ However, lsfg-vk provides several CMake options to customize the build process:
- `LSFGVK_BUILD_VK_LAYER`: Set to `On` to build the Vulkan layer (default is `On`).
- `LSFGVK_BUILD_UI`: Set to `On` to build the user interface (default is `Off`).
- `LSFGVK_BUILD_CLI`: Set to `On` to build the command-line interface (default is `On`).
- `LSFGVK_INSTALL_DEVELOP`: Set to `On` to install development files like headers and libraries (default is `Off`).
- `LSFGVK_INSTALL_LIBRARIES`: Set to `On` to install development files like headers and libraries (default is `Off`).
- `LSFGVK_INSTALL_XDG_FILES`: Set to `On` to install XDG desktop files and icons (default is `Off`).
- `LSFGVK_LAYER_LIBRARY_PATH`: Override the path to the Vulkan layer library (by default, Vulkan will search the systems library path).

View file

@ -23,8 +23,3 @@ Checks:
- -cppcoreguidelines-macro-usage
- -bugprone-easily-swappable-parameters
- -portability-avoid-pragma-once
# Vulkan requires the use of reinterpret/const casts in many places
- -cppcoreguidelines-pro-type-reinterpret-cast
- -cppcoreguidelines-pro-type-const-cast
# We use namespace forward declarations
- -bugprone-forward-declaration-namespace

View file

@ -1,33 +1,24 @@
set(BACKEND_SOURCES
"src/extraction/dll_reader.cpp"
"src/extraction/shader_registry.cpp"
"src/helpers/limits.cpp"
"src/helpers/managed_shader.cpp"
"src/helpers/utils.cpp"
"src/shaderchains/alpha0.cpp"
"src/shaderchains/alpha1.cpp"
"src/shaderchains/beta0.cpp"
"src/shaderchains/beta1.cpp"
"src/shaderchains/delta0.cpp"
"src/shaderchains/delta1.cpp"
"src/shaderchains/gamma0.cpp"
"src/shaderchains/gamma1.cpp"
"src/shaderchains/generate.cpp"
"src/shaderchains/mipmaps.cpp"
"src/modules/library/dll.cpp"
"src/modules/library.cpp"
"src/modules/pipeline.cpp"
"src/utility/logger.cpp"
"src/utility/pipelines.cpp"
"src/utility/vkhelper.cpp"
"src/lsfgvk.cpp")
add_library(lsfg-vk-backend STATIC ${BACKEND_SOURCES})
target_include_directories(lsfg-vk-backend
PUBLIC include)
PUBLIC include
PRIVATE src)
target_link_libraries(lsfg-vk-backend
PUBLIC lsfg-vk-common)
target_compile_options(lsfg-vk-backend PUBLIC
$<$<CXX_COMPILER_ID:Clang>:-fconstexpr-steps=4290000000>
$<$<CXX_COMPILER_ID:GNU>:-fconstexpr-ops-limit=4290000000>
)
set_target_properties(lsfg-vk-backend PROPERTIES
CXX_VISIBILITY_PRESET hidden)
if(LSFGVK_INSTALL_DEVELOP)
if(LSFGVK_INSTALL_LIBRARIES)
install(TARGETS lsfg-vk-backend
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
install(DIRECTORY "include/lsfg-vk-backend/"

View file

@ -23,7 +23,12 @@ target_include_directories(lsfg-vk-common
target_include_directories(lsfg-vk-common SYSTEM
PRIVATE thirdparty/include)
if(LSFGVK_INSTALL_DEVELOP)
target_compile_options(lsfg-vk-common PUBLIC
-Wno-cast-function-type-strict # Vulkan function pointers
-Wno-shadow # Shadowing variables used to be common practice
)
if(LSFGVK_INSTALL_LIBRARIES)
install(TARGETS lsfg-vk-common
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
install(DIRECTORY "include/lsfg-vk-common/"