Remove outdated flag VULKAN_HPP_SAMPLES_BUILD_ONLY_DYNAMIC (#2229)

This commit is contained in:
Andreas Süßenbach 2025-07-28 17:59:43 +02:00 committed by GitHub
parent 167bb6afe0
commit cc01933661
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 38 additions and 23 deletions

View File

@ -42,7 +42,6 @@ option( VULKAN_HPP_RUN_GENERATOR "Run the HPP generator" OFF )
option( VULKAN_HPP_GENERATOR_BUILD "Build the HPP generator" ${PROJECT_IS_TOP_LEVEL} )
option( VULKAN_HPP_SAMPLES_BUILD "Build samples" OFF )
option( VULKAN_HPP_TESTS_BUILD "Build tests" OFF )
option( VULKAN_HPP_SAMPLES_BUILD_ONLY_DYNAMIC "Build only dynamic. Required in case the Vulkan SDK is not available" OFF )
option( VULKAN_HPP_BUILD_WITH_LOCAL_VULKAN_HPP "Build with local Vulkan headers" ON )
option( VULKAN_HPP_ENABLE_CPP20_MODULES "Build Vulkan-Hpp as C++20 module; requires minimum CMake version 3.28" OFF )
option( VULKAN_HPP_ENABLE_STD_MODULE "Build Vulkan-Hpp with import std; requires minimum CMake version 3.30" OFF )
@ -424,7 +423,7 @@ function( vulkan_hpp__setup_sample )
set( multiValueArgs HEADERS LIBS PCH SOURCES )
cmake_parse_arguments( TARGET "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
if( NOT (VULKAN_HPP_SAMPLES_BUILD_ONLY_DYNAMIC AND VULKAN_HPP_BUILD_WITH_LOCAL_VULKAN_HPP) )
if( NOT VULKAN_HPP_BUILD_WITH_LOCAL_VULKAN_HPP )
find_package( Vulkan REQUIRED )
endif()
@ -461,22 +460,20 @@ function( vulkan_hpp__setup_sample_static )
set( multiValueArgs )
cmake_parse_arguments( TARGET "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
if( NOT VULKAN_HPP_SAMPLES_BUILD_ONLY_DYNAMIC )
if( NOT TARGET_NAME )
message( FATAL_ERROR "NAME must be defined in vulkan_hpp__setup_sample_static" )
endif()
find_package( Vulkan REQUIRED )
vulkan_hpp__setup_sample(
NAME ${TARGET_NAME}
FOLDER Samples
PCH <vulkan/vulkan.hpp>
SOURCES ${TARGET_NAME}.cpp
LIBS ${Vulkan_LIBRARIES} )
target_compile_definitions( ${TARGET_NAME} PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=0 )
if( NOT TARGET_NAME )
message( FATAL_ERROR "NAME must be defined in vulkan_hpp__setup_sample_static" )
endif()
find_package( Vulkan REQUIRED )
vulkan_hpp__setup_sample(
NAME ${TARGET_NAME}
FOLDER Samples
PCH <vulkan/vulkan.hpp>
SOURCES ${TARGET_NAME}.cpp
LIBS ${Vulkan_LIBRARIES} )
target_compile_definitions( ${TARGET_NAME} PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=0 )
endfunction()
function( vulkan_hpp__setup_sample_dynamic )

View File

@ -12,4 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
vulkan_hpp__setup_sample_static( NAME 01_InitInstance )
find_package( Vulkan QUIET )
if ( Vulkan_FOUND )
vulkan_hpp__setup_sample_static( NAME 01_InitInstance )
endif()

View File

@ -12,4 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
vulkan_hpp__setup_sample_static( NAME CreateDebugUtilsMessenger )
find_package( Vulkan QUIET )
if ( Vulkan_FOUND )
vulkan_hpp__setup_sample_static( NAME CreateDebugUtilsMessenger )
endif()

View File

@ -12,4 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
vulkan_hpp__setup_sample_static( NAME InstanceExtensionProperties )
find_package( Vulkan QUIET )
if ( Vulkan_FOUND )
vulkan_hpp__setup_sample_static( NAME InstanceExtensionProperties )
endif()

View File

@ -12,4 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
vulkan_hpp__setup_sample_static( NAME InstanceLayerExtensionProperties )
find_package( Vulkan QUIET )
if ( Vulkan_FOUND )
vulkan_hpp__setup_sample_static( NAME InstanceLayerExtensionProperties )
endif()

View File

@ -12,4 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
vulkan_hpp__setup_sample_static( NAME InstanceLayerProperties )
find_package( Vulkan QUIET )
if ( Vulkan_FOUND )
vulkan_hpp__setup_sample_static( NAME InstanceLayerProperties )
endif()

View File

@ -12,4 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
vulkan_hpp__setup_sample_static( NAME InstanceVersion )
find_package( Vulkan QUIET )
if ( Vulkan_FOUND )
vulkan_hpp__setup_sample_static( NAME InstanceVersion )
endif()