Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Add build target for vkcube-display #1027

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions cube/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "Linux|BSD|GNU")
option(BUILD_WSI_XCB_SUPPORT "Build XCB WSI support" ON)
option(BUILD_WSI_XLIB_SUPPORT "Build Xlib WSI support" ON)
option(BUILD_WSI_WAYLAND_SUPPORT "Build Wayland WSI support" ON)
option(BUILD_WSI_DISPLAY_SUPPORT "Build Display WSI support" ON)
option(BUILD_WSI_DIRECTFB_SUPPORT "Build DirectFB WSI support" OFF)
set(CUBE_WSI_SELECTION "XCB" CACHE STRING "Select WSI target for vkcube (XCB, XLIB, WAYLAND, DIRECTFB, DISPLAY)")

Expand Down Expand Up @@ -321,6 +322,33 @@ else()
install(TARGETS vkcubepp)
endif()

# ----------------------------------------------------------------------------
# vkcube-display

if(CMAKE_SYSTEM_NAME MATCHES "Linux|BSD|GNU")
if(BUILD_WSI_DISPLAY_SUPPORT)
add_executable(vkcube-display)
target_sources(vkcube-display PRIVATE
cube.c
${PROJECT_SOURCE_DIR}/cube/cube.vert
${PROJECT_SOURCE_DIR}/cube/cube.frag
cube.vert.inc
cube.frag.inc
)
target_compile_definitions(vkcube-display PRIVATE VK_USE_PLATFORM_DISPLAY_KHR)
include(CheckLibraryExists)
CHECK_LIBRARY_EXISTS("rt" clock_gettime "" NEED_RT)
if (NEED_RT)
target_link_libraries(vkcube-display PRIVATE rt)
endif()
target_link_libraries(vkcube-display PRIVATE Vulkan::Headers volk::volk_headers Threads::Threads)

target_include_directories(vkcube-display PRIVATE .)

install(TARGETS vkcube-display)
endif()
endif()

# ----------------------------------------------------------------------------
# vkcube-wayland

Expand Down