The repository contains everything required to compile and build the examples on Windows, Linux and Android using a C++ compiler that supports C++11. All required dependencies are included.
Use the provided CMakeLists.txt with CMake to generate a build configuration for your favorite IDE or compiler, e.g.:
cmake -G "Visual Studio 16 2019" -A x64
Use the provided CMakeLists.txt with CMake to generate a build configuration for your favorite IDE or compiler.
- XCB: Default WSI (if no cmake option is specified)
- Wayland: Use cmake option
USE_WAYLAND_WSI
(-DUSE_WAYLAND_WSI=ON
) - DirectFB: Use cmake option
USE_DIRECTFB_WSI
(-DUSE_DIRECTFB_WSI=ON
) - DirectToDisplay: Use cmake option
USE_D2D_WSI
(-DUSE_D2D_WSI=ON
)
Building on Android is done using the Gradle Build Tool:
If you want to build it through command line, set Android SDK/NDK by environment variable ANDROID_SDK_ROOT
/ANDROID_NDK_HOME
.
On Linux execute:
cd android
./gradlew assembleDebug
This will download gradle locally, build all samples and output the apks to android/examples/bin
.
On Windows execute gradlew.bat assembleDebug
.
If you want to build and install on a connected device or emulator image, run gradle installDebug
instead.
If you want to build it through Android Studio, open project folder android
in Android Studio.
Building for iOS and macOS is done using the examples Xcode project found in the xcode directory. These examples use the MoltenVK Vulkan driver to provide Vulkan support on iOS and macOS, and require an iOS or macOS device that supports Metal. Please see the MoltenVK Examples readme for more info on acquiring MoltenVK and building and deploying the examples on iOS and macOS.
Install Libomp with:
-brew install libomp
find the path
-brew --prefix libomp
use the path from the above command to populate the path in the -DOpenMP_C_FLAGS, -DOpenMP_omp_LIBRARY & -DOpenMP_CXX_FOUND statement below
Download Vulkan SDK and install it note the path as this will need to be configure in Xcode curl -O https://sdk.lunarg.com/sdk/download/latest/mac/vulkan_sdk.dmg
Open vulkan_sdk.dmg and install Vulkan SDK Navigate to the Vulkan SDK folder and run 'python install_vulkan.py'
Use the provided CMakeLists.txt with CMake to generate a build configuration for your favorite IDE or compiler, e.g.:
Example of cmake with libraries defined
cmake -G "Xcode" -DOpenMP_C_FLAGS=/usr/local/opt/libomp -DOpenMP_omp_LIBRARY=/usr/local/opt/libomp -DOpenMP_CXX_FOUND=/usr/local/opt/libomp