mirror of
https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git
synced 2024-11-27 00:44:35 +00:00
Make building shaders, VMA example application and VMA replay app optional
This commit is contained in:
parent
69747a2bdb
commit
e32721df9e
@ -9,4 +9,9 @@ find_package(Vulkan REQUIRED)
|
|||||||
# Put binaries into bin folder
|
# Put binaries into bin folder
|
||||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
|
||||||
|
|
||||||
|
# VulkanMemoryAllocator contains an example application and VmaReplay which are not build by default
|
||||||
|
option(VMA_BUILD_EXAMPLE_APP "Build VulkanMemoryAllocator example application" OFF)
|
||||||
|
option(VMA_BUILD_EXAMPLE_APP_SHADERS "Build VulkanMemoryAllocator example application's shaders" OFF)
|
||||||
|
option(VMA_BUILD_REPLAY_APP "Build VulkanMemoryAllocator replay application" OFF)
|
||||||
|
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
add_subdirectory(Shaders)
|
if(VMA_BUILD_EXAMPLE_APP_SHADERS)
|
||||||
add_subdirectory(VmaReplay)
|
add_subdirectory(Shaders)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(VMA_BUILD_REPLAY_APP)
|
||||||
|
add_subdirectory(VmaReplay)
|
||||||
|
endif()
|
||||||
|
|
||||||
set(VMA_LIBRARY_SOURCE_FILES
|
set(VMA_LIBRARY_SOURCE_FILES
|
||||||
VmaUsage.cpp
|
VmaUsage.cpp
|
||||||
@ -20,10 +25,10 @@ foreach(FILE ${VMA_LIBRARY_SOURCE_FILES})
|
|||||||
source_group("${GROUP}" FILES "${FILE}")
|
source_group("${GROUP}" FILES "${FILE}")
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
add_library(VmaLibrary ${VMA_LIBRARY_SOURCE_FILES})
|
add_library(VulkanMemoryAllocator ${VMA_LIBRARY_SOURCE_FILES})
|
||||||
|
|
||||||
set_target_properties(
|
set_target_properties(
|
||||||
VmaLibrary PROPERTIES
|
VulkanMemoryAllocator PROPERTIES
|
||||||
|
|
||||||
CXX_EXTENSIONS OFF
|
CXX_EXTENSIONS OFF
|
||||||
# Use C++14
|
# Use C++14
|
||||||
@ -32,14 +37,14 @@ set_target_properties(
|
|||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(
|
target_include_directories(
|
||||||
VmaLibrary
|
VulkanMemoryAllocator
|
||||||
|
|
||||||
PUBLIC
|
PUBLIC
|
||||||
${PROJECT_SOURCE_DIR}/include
|
${PROJECT_SOURCE_DIR}/include
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
VmaLibrary
|
VulkanMemoryAllocator
|
||||||
|
|
||||||
PUBLIC
|
PUBLIC
|
||||||
Vulkan::Vulkan
|
Vulkan::Vulkan
|
||||||
@ -67,12 +72,10 @@ foreach(FILE ${VMA_EXAMPLE_SOURCE_FILES})
|
|||||||
source_group("${GROUP}" FILES "${FILE}")
|
source_group("${GROUP}" FILES "${FILE}")
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
IF (WIN32)
|
if (VMA_BUILD_EXAMPLE_APP)
|
||||||
|
if(WIN32)
|
||||||
add_executable(VmaExample ${VMA_EXAMPLE_SOURCE_FILES})
|
add_executable(VmaExample ${VMA_EXAMPLE_SOURCE_FILES})
|
||||||
|
|
||||||
# Make sure to compile shaders when compiling the example
|
|
||||||
add_dependencies(VmaExample VmaShaders)
|
|
||||||
|
|
||||||
# Visual Studio specific settings
|
# Visual Studio specific settings
|
||||||
if(${CMAKE_GENERATOR} MATCHES "Visual Studio.*")
|
if(${CMAKE_GENERATOR} MATCHES "Visual Studio.*")
|
||||||
# Use Unicode instead of multibyte set
|
# Use Unicode instead of multibyte set
|
||||||
@ -106,7 +109,7 @@ IF (WIN32)
|
|||||||
PRIVATE
|
PRIVATE
|
||||||
VmaLibrary
|
VmaLibrary
|
||||||
)
|
)
|
||||||
|
else()
|
||||||
ELSE()
|
|
||||||
message(STATUS "VmaExample application is not supported to Linux")
|
message(STATUS "VmaExample application is not supported to Linux")
|
||||||
ENDIF()
|
endif()
|
||||||
|
endif()
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# This file will only be executed if VMA_BUILD_EXAMPLE_APP_SHADERS is set to ON
|
||||||
|
|
||||||
find_program(GLSL_VALIDATOR glslangValidator REQUIRED)
|
find_program(GLSL_VALIDATOR glslangValidator REQUIRED)
|
||||||
|
|
||||||
if(NOT GLSL_VALIDATOR)
|
if(NOT GLSL_VALIDATOR)
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
IF (WIN32)
|
# This file will only be executed if VMA_BUILD_REPLAY_APP is set to ON
|
||||||
|
|
||||||
|
if (WIN32)
|
||||||
set(VMA_REPLAY_SOURCE_FILES
|
set(VMA_REPLAY_SOURCE_FILES
|
||||||
Common.cpp
|
Common.cpp
|
||||||
Constants.cpp
|
Constants.cpp
|
||||||
@ -14,6 +16,6 @@ IF (WIN32)
|
|||||||
PRIVATE
|
PRIVATE
|
||||||
Vulkan::Vulkan
|
Vulkan::Vulkan
|
||||||
)
|
)
|
||||||
ELSE()
|
else()
|
||||||
message(STATUS "VmaReplay is not supported on Linux")
|
message(STATUS "VmaReplay is not supported on Linux")
|
||||||
ENDIF()
|
endif()
|
||||||
|
Loading…
Reference in New Issue
Block a user