aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Nopper <norbert@nopper.tv>2016-09-08 09:31:36 +0200
committerKarl Schultz <karl@lunarg.com>2016-09-12 11:55:47 -0600
commit747e2e4502360bfff57c844caf8ea835487a2261 (patch)
tree5e213c61b100981ec843d8b3ae5293d3b101ac1b
parente4f85ff171bdcb71b0d64e18627225aad2495fa1 (diff)
downloadusermoji-747e2e4502360bfff57c844caf8ea835487a2261.tar.xz
Fix, that display only build under Linux works
-rw-r--r--CMakeLists.txt8
-rw-r--r--demos/CMakeLists.txt54
-rwxr-xr-xvk-layer-generate.py4
3 files changed, 42 insertions, 24 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 602f01fc..4ed50922 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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)
diff --git a/demos/CMakeLists.txt b/demos/CMakeLists.txt
index 26e86fb8..e61065ff 100644
--- a/demos/CMakeLists.txt
+++ b/demos/CMakeLists.txt
@@ -67,23 +67,24 @@ if(WIN32)
file(COPY tri.vcxproj.user DESTINATION ${CMAKE_BINARY_DIR}/demos)
file(COPY vulkaninfo.vcxproj.user DESTINATION ${CMAKE_BINARY_DIR}/demos)
else()
- add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/demos/tri-vert.spv
- COMMAND ${GLSLANG_VALIDATOR} -s -V -o tri-vert.spv ${PROJECT_SOURCE_DIR}/demos/tri.vert
- DEPENDS tri.vert ${GLSLANG_VALIDATOR}
- )
- add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/demos/tri-frag.spv
- COMMAND ${GLSLANG_VALIDATOR} -s -V -o tri-frag.spv ${PROJECT_SOURCE_DIR}/demos/tri.frag
- DEPENDS tri.frag ${GLSLANG_VALIDATOR}
- )
- add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/demos/cube-vert.spv
- COMMAND ${GLSLANG_VALIDATOR} -s -V -o cube-vert.spv ${PROJECT_SOURCE_DIR}/demos/cube.vert
- DEPENDS cube.vert ${GLSLANG_VALIDATOR}
- )
-
- add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/demos/cube-frag.spv
- COMMAND ${GLSLANG_VALIDATOR} -s -V -o cube-frag.spv ${PROJECT_SOURCE_DIR}/demos/cube.frag
- DEPENDS cube.frag ${GLSLANG_VALIDATOR}
- )
+ if (${CMAKE_SYSTEM_PROCESSOR} EQUAL ${CMAKE_HOST_SYSTEM_PROCESSOR})
+ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/demos/tri-vert.spv
+ COMMAND ${GLSLANG_VALIDATOR} -s -V -o tri-vert.spv ${PROJECT_SOURCE_DIR}/demos/tri.vert
+ DEPENDS tri.vert ${GLSLANG_VALIDATOR}
+ )
+ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/demos/tri-frag.spv
+ COMMAND ${GLSLANG_VALIDATOR} -s -V -o tri-frag.spv ${PROJECT_SOURCE_DIR}/demos/tri.frag
+ DEPENDS tri.frag ${GLSLANG_VALIDATOR}
+ )
+ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/demos/cube-vert.spv
+ COMMAND ${GLSLANG_VALIDATOR} -s -V -o cube-vert.spv ${PROJECT_SOURCE_DIR}/demos/cube.vert
+ DEPENDS cube.vert ${GLSLANG_VALIDATOR}
+ )
+ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/demos/cube-frag.spv
+ COMMAND ${GLSLANG_VALIDATOR} -s -V -o cube-frag.spv ${PROJECT_SOURCE_DIR}/demos/cube.frag
+ DEPENDS cube.frag ${GLSLANG_VALIDATOR}
+ )
+ endif()
endif()
if(NOT WIN32)
@@ -116,15 +117,21 @@ add_executable(vulkaninfo vulkaninfo.c)
target_link_libraries(vulkaninfo ${LIBRARIES})
if(UNIX)
- add_executable(tri tri.c ${CMAKE_BINARY_DIR}/demos/tri-vert.spv ${CMAKE_BINARY_DIR}/demos/tri-frag.spv)
+ if (${CMAKE_SYSTEM_PROCESSOR} EQUAL ${CMAKE_HOST_SYSTEM_PROCESSOR})
+ add_executable(tri tri.c ${CMAKE_BINARY_DIR}/demos/tri-vert.spv ${CMAKE_BINARY_DIR}/demos/tri-frag.spv)
+ endif()
else()
add_executable(tri WIN32 tri.c ${CMAKE_BINARY_DIR}/demos/tri-vert.spv ${CMAKE_BINARY_DIR}/demos/tri-frag.spv)
endif()
-target_link_libraries(tri ${LIBRARIES})
+if (${CMAKE_SYSTEM_PROCESSOR} EQUAL ${CMAKE_HOST_SYSTEM_PROCESSOR})
+ target_link_libraries(tri ${LIBRARIES})
+endif()
if(NOT WIN32)
- add_executable(cube cube.c ${CMAKE_BINARY_DIR}/demos/cube-vert.spv ${CMAKE_BINARY_DIR}/demos/cube-frag.spv)
- target_link_libraries(cube ${LIBRARIES})
+ if (${CMAKE_SYSTEM_PROCESSOR} EQUAL ${CMAKE_HOST_SYSTEM_PROCESSOR})
+ add_executable(cube cube.c ${CMAKE_BINARY_DIR}/demos/cube-vert.spv ${CMAKE_BINARY_DIR}/demos/cube-frag.spv)
+ target_link_libraries(cube ${LIBRARIES})
+ endif()
else()
if (CMAKE_CL_64)
set (LIB_DIR "Win64")
@@ -136,5 +143,6 @@ else()
target_link_libraries(cube ${LIBRARIES} )
endif()
-add_subdirectory(smoke)
-
+if (${CMAKE_SYSTEM_PROCESSOR} EQUAL ${CMAKE_HOST_SYSTEM_PROCESSOR})
+ add_subdirectory(smoke)
+endif()
diff --git a/vk-layer-generate.py b/vk-layer-generate.py
index 5301e262..015826f4 100755
--- a/vk-layer-generate.py
+++ b/vk-layer-generate.py
@@ -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 = {