Skip to content

Commit

Permalink
Make vulkan build as optional (google#4814)
Browse files Browse the repository at this point in the history
Add option WITH_VULKAN, which is ON by default.
If set to OFF, packages OrbitTriggerCaptureVulkanLayer, OrbitVulkanLayer,
and VulkanTutorial won't be built
  • Loading branch information
alexkalmuk committed Mar 6, 2023
1 parent 3034421 commit bd251df
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ endif()
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

option(WITH_GUI "Setting this option will enable the Qt-based UI client." ON)
option(WITH_VULKAN "Setting this option will enable Vulkan" ON)

# This is only for designated initializers
if(WIN32)
Expand Down Expand Up @@ -127,9 +128,11 @@ else()
find_package(libbase REQUIRED)
find_package(liblog REQUIRED)
find_package(libprocinfo REQUIRED)
find_package(volk REQUIRED)
find_package(VulkanHeaders REQUIRED)
find_package(vulkan-validationlayers REQUIRED)
if(WITH_VULKAN)
find_package(volk REQUIRED)
find_package(VulkanHeaders REQUIRED)
find_package(vulkan-validationlayers REQUIRED)
endif()
endif()

include("cmake/protobuf.cmake")
Expand Down Expand Up @@ -173,13 +176,15 @@ else()
add_subdirectory(src/OrbitClientGgp)
add_subdirectory(src/OrbitCaptureGgpClient)
add_subdirectory(src/OrbitCaptureGgpService)
add_subdirectory(src/OrbitTriggerCaptureVulkanLayer)
add_subdirectory(src/OrbitVulkanLayer)
add_subdirectory(src/ProcessService)
add_subdirectory(src/TracepointService)
add_subdirectory(src/UserSpaceInstrumentation)
add_subdirectory(src/VulkanTutorial)
add_subdirectory(third_party/libunwindstack)
if(WITH_VULKAN)
add_subdirectory(src/OrbitTriggerCaptureVulkanLayer)
add_subdirectory(src/OrbitVulkanLayer)
add_subdirectory(src/VulkanTutorial)
endif()
endif()

add_subdirectory(src/Api)
Expand Down

0 comments on commit bd251df

Please sign in to comment.