The build process uses CMake to generate makefiles for this project.
The build generates the loader, layers, and tests.
-This repo has been built and tested on Ubuntu 14.04.3 LTS, 14.10, 15.04, 15.10, and 16.04 LTS.
+This repo has been built and tested on the two most recent Ubuntu LTS versions.
It should be straightforward to use it on other Linux distros.
These packages are needed to build this repository:
```
-sudo apt-get install git cmake build-essential bison libx11-dev libxcb1-dev libxkbcommon-dev
+sudo apt-get install git cmake build-essential bison libx11-dev libxcb1-dev libxkbcommon-dev libmirclient-dev libwayland-dev
```
Example debug build (Note that the update\_external\_sources script used below builds external tools into predefined locations. See **Loader and Validation Layer Dependencies** for more information and other options):
describes both how ICDs and layers should be properly
packaged, and how developers can point to ICDs and layers within their builds.
+### WSI Support Build Options
+By default, the Vulkan Loader and Validation Layers are built with support for all 4 Vulkan-defined WSI display systems, Xcb, Xlib, Wayland, and Mir. It is recommended to build these modules with support for these
+display systems to maximize their usability across Linux platforms.
+If it is necessary to build these modules without support for one of the display systems, the appropriate CMake option of the form BUILD_WSI_xxx_SUPPORT can be set to OFF. See the top-level CMakeLists.txt file for more info.
+
### Linux Install to System Directories
Installing the files resulting from your build to the systems directories is optional since
- cube: a textured spinning cube
- smoke/smoke: A "smoke" test using a more complex Vulkan demo
+You can select which WSI subsystem is used to build the demos using a cmake option called DEMOS_WSI_SELECTION.
+Supported options are XCB (default), XLIB, WAYLAND, and MIR. Note that you must build using the corresponding BUILD_WSI_*_SUPPORT enabled at the base repo level (all SUPPORT options are ON by default).
+For instance, creating a build that will use Xlib to build the demos, your cmake command line might look like:
+
+cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Debug -DDEMOS_WSI_SELECTION=XLIB
+
## Windows System Requirements
Windows 7+ with additional required software packages:
option(BUILD_WSI_XLIB_SUPPORT "Build Xlib WSI support" ON)
option(BUILD_WSI_WAYLAND_SUPPORT "Build Wayland WSI support" ON)
option(BUILD_WSI_MIR_SUPPORT "Build Mir WSI support" ON)
+ option(DEMOS_WSI_SELECTION "Select WSI to use to build demos" XCB)
endif()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
elseif(CMAKE_SYSTEM_NAME STREQUAL "Android")
add_definitions(-DVK_USE_PLATFORM_ANDROID_KHR)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
- if(BUILD_WSI_XCB_SUPPORT)
- add_definitions(-DVK_USE_PLATFORM_XCB_KHR)
+ if (NOT DEMOS_WSI_SELECTION)
+ set(DEMOS_WSI_SELECTION "XCB")
+ endif()
+
+ if (DEMOS_WSI_SELECTION STREQUAL "XCB")
+ if (NOT BUILD_WSI_XCB_SUPPORT)
+ message( FATAL_ERROR "Selected XCB for demos build but not building Xcb support" )
+ endif()
find_package(XCB REQUIRED)
include_directories(${XCB_INCLUDE_DIRS})
link_libraries(${XCB_LIBRARIES})
- endif()
- if(BUILD_WSI_XLIB_SUPPORT)
- add_definitions(-DVK_USE_PLATFORM_XLIB_KHR)
+ add_definitions(-DVK_USE_PLATFORM_XCB_KHR)
+ elseif(DEMOS_WSI_SELECTION STREQUAL "XLIB")
+ if (NOT BUILD_WSI_XLIB_SUPPORT)
+ message( FATAL_ERROR "Selected XLIB for demos build but not building Xlib support" )
+ endif()
find_package(X11 REQUIRED)
include_directories(${X11_INCLUDE_DIR})
link_libraries(${X11_LIBRARIES})
- endif()
- if(BUILD_WSI_WAYLAND_SUPPORT)
- add_definitions(-DVK_USE_PLATFORM_WAYLAND_KHR)
+ add_definitions(-DVK_USE_PLATFORM_XLIB_KHR)
+ elseif(DEMOS_WSI_SELECTION STREQUAL "WAYLAND")
+ if (NOT BUILD_WSI_WAYLAND_SUPPORT)
+ message( FATAL_ERROR "Selected Wayland for demos build but not building Wayland support" )
+ endif()
find_package(Wayland REQUIRED)
include_directories(${WAYLAND_CLIENT_INCLUDE_DIR})
link_libraries(${WAYLAND_CLIENT_LIBRARIES})
include_directories ("${PROJECT_SOURCE_DIR}/icd/common")
link_libraries(${API_LOWERCASE} m)
+else()
+ message(FATAL_ERROR "Unsupported Platform!")
endif()
file(GLOB TEXTURES
endif()
if ((${CMAKE_SYSTEM_PROCESSOR} STREQUAL ${CMAKE_HOST_SYSTEM_PROCESSOR}))
- if (BUILD_WSI_XCB_SUPPORT OR BUILD_WSI_WAYLAND_SUPPORT OR WIN32 OR (CMAKE_SYSTEM_NAME STREQUAL "Android"))
+ if ((DEMOS_WSI_SELECTION STREQUAL "XCB") OR (DEMOS_WSI_SELECTION STREQUAL "WAYLAND") OR WIN32 OR (CMAKE_SYSTEM_NAME STREQUAL "Android"))
add_subdirectory(smoke)
endif()
endif()