Fix, that display only build under Linux works

This commit is contained in:
Norbert Nopper 2016-09-08 09:31:36 +02:00 committed by Karl Schultz
parent 1ec0e0372a
commit 2233bb009b
3 changed files with 19 additions and 3 deletions

View File

@ -44,6 +44,10 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
add_definitions(-DVK_USE_PLATFORM_MIR_KHR)
set(DisplayServer Mir)
endif()
if (NOT BUILD_WSI_XCB_SUPPORT AND NOT BUILD_WSI_XLIB_SUPPORT AND NOT BUILD_WSI_WAYLAND_SUPPORT AND NOT BUILD_WSI_MIR_SUPPORT)
set(DisplayServer Display)
endif()
else()
message(FATAL_ERROR "Unsupported Platform!")
endif()
@ -74,7 +78,9 @@ if(WIN32)
endif()
if(NOT WIN32)
find_package(XCB REQUIRED)
if (BUILD_WSI_XCB_SUPPORT)
find_package(XCB REQUIRED)
endif()
set (BUILDTGT_DIR build)
set (BINDATA_DIR Bin)
set (LIBSOURCE_DIR Lib)

View File

@ -12,7 +12,9 @@ if (WIN32)
endif()
else()
include (FindPkgConfig)
find_package(XCB REQUIRED)
if (BUILD_WSI_XCB_SUPPORT)
find_package(XCB REQUIRED)
endif()
endif()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
@ -82,7 +84,11 @@ set_target_properties(vk_layer_validation_tests
PROPERTIES
COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1")
if(NOT WIN32)
target_link_libraries(vk_layer_validation_tests ${LIBVK} ${XCB_LIBRARIES} ${X11_LIBRARIES} gtest gtest_main VkLayer_utils ${GLSLANG_LIBRARIES})
if (BUILD_WSI_XCB_SUPPORT AND BUILD_WSI_XLIB_SUPPORT)
target_link_libraries(vk_layer_validation_tests ${LIBVK} ${XCB_LIBRARIES} ${X11_LIBRARIES} gtest gtest_main VkLayer_utils ${GLSLANG_LIBRARIES})
else()
target_link_libraries(vk_layer_validation_tests ${LIBVK} gtest gtest_main VkLayer_utils ${GLSLANG_LIBRARIES})
endif()
endif()
if(WIN32)
target_link_libraries(vk_layer_validation_tests ${LIBVK} gtest gtest_main VkLayer_utils ${GLSLANG_LIBRARIES})

View File

@ -1028,6 +1028,9 @@ class UniqueObjectsSubcommand(Subcommand):
('xlib_enabled', ['vkCreateXlibSurfaceKHR']),
('wayland_enabled', ['vkCreateWaylandSurfaceKHR']),
('mir_enabled', ['vkCreateMirSurfaceKHR'])]
elif self.wsi == 'Display':
instance_extensions=[('wsi_enabled', surface_wsi_instance_exts),
('display_enabled', display_wsi_instance_exts)]
else:
print('Error: Undefined DisplayServer')
instance_extensions=[]
@ -1049,6 +1052,7 @@ def main():
"Xlib",
"Wayland",
"Mir",
"Display",
}
subcommands = {