]> O.S.I.I.S - jp/vkvg.git/commitdiff
update window build tutorial, add vulkan include dir to offscreen test include pathes
authorj-p <jp_bruyere@hotmail.com>
Mon, 27 Dec 2021 05:13:07 +0000 (06:13 +0100)
committerj-p <jp_bruyere@hotmail.com>
Mon, 27 Dec 2021 05:13:07 +0000 (06:13 +0100)
CMakeLists.txt
doc/windows_build_tutorial.md

index a425f775a12374fb7c1b754d1a47af9d4b7c595d..f24da55a28f047514a0b51aaeeaec732619b4853 100644 (file)
@@ -256,6 +256,7 @@ IF (VKVG_BUILD_TESTS)
 ELSEIF (VKVG_BUILD_OFFSCREEN_TEST)
        ADD_EXECUTABLE(test_offscreen "${CMAKE_CURRENT_SOURCE_DIR}/tests/offscreen.c")
        TARGET_INCLUDE_DIRECTORIES(test_offscreen PRIVATE
+               ${Vulkan_INCLUDE_DIRS}
                ${CMAKE_CURRENT_SOURCE_DIR}/include
        )
        TARGET_LINK_LIBRARIES(test_offscreen
index 943c759cb834eced5d705a4fd7ab1ebb33238881..cb60b6e5305fcc894c71d77f5d8dd1527b91b19f 100644 (file)
@@ -5,35 +5,41 @@ Ensure [CMake and c/c++ support options](https://docs.microsoft.com/en-us/visual
 
 The easyest way to proceed is to open a visual studio command prompt, and issue commands manually. Once dependencies are build and vkvg project files have been created, you may use the ide.
 
-#### Build dependencies
-Install the latest [vulkan sdk](https://vulkan.lunarg.com/) from lunarg.
-
+## Build dependencies
 Make sure that [Git](https://git-scm.com/download/win) is installed on your machine by typing on the command line (cmd):
 ```bash
 > git --version
 git version 2.19.1.windows.1
 ```
-Install [vcpkg package manager](https://docs.microsoft.com/en-us/cpp/build/vcpkg?view=vs-2019) to build required libraries:
+
+The only required dependency is vulkan, the header and library. To compile shaders you'll also need the `glslc` compiler. The easyest way is to install the the latest [vulkan sdk](https://vulkan.lunarg.com/) from lunarg, and set the environment variable `VULKAN_SDK` to the installation path of the sdk.
+
+The following 3 libraries help with text shaping and font handling, but are optional.
+- Fontconfig: find font file from a short name with style.
+- Freetype: glyph rendering library, may be replaced by stb_truetype.
+- Harfbuzz: text shaping library, help handling complex glyph combination.
+
+The last dependency is [GLFW](https://www.glfw.org/), required by on screen samples to create and handle the native windows. If not present, an offscreen test will be optionaly built.
+
+All those dependencies may be installed on windows with [vcpkg package manager](https://docs.microsoft.com/en-us/cpp/build/vcpkg?view=vs-2019).
+
 ```bash
 git clone https://github.com/Microsoft/vcpkg.git
 cd vcpkg
 .\bootstrap-vcpkg.bat
 ```
-Then install the libraries required by vkvg, use the triplet corresponding with your architecture:
-```bash
-vcpkg install fontconfig:x64-windows freetype:x64-windows harfbuzz:x64-windows
-```
-Optionaly, install [GLFW] to build the samples:
+Then install libraries, use the triplet corresponding with your architecture:
 ```bash
-vcpkg install glfw3:x64-windows
+vcpkg install fontconfig:x64-windows freetype:x64-windows harfbuzz:x64-windows glfw3:x64-windows
 ```
+
 Add the path to the shared libraries binaries to your **PATH** environment variable, they are in %vcpkg-root%/installed/x64-windows/bin/.
 
 To make those libraries available for vsstudio use the [system wide integration](https://vcpkg.readthedocs.io/en/latest/examples/installing-and-using-packages/#vsmsbuild-project-user-wide-integration) from vcpkg.
 ```bash
 vcpkg integrate install
 ```
-#### CMake configuration
+## CMake configuration
 Exit vcpkg directory and clone the vkvg repository and its submodule vkh:
 ```bash
 git clone --recursive https://github.com/jpbruyere/vkvg.git
@@ -45,11 +51,12 @@ To generate the solution file (.sln) from the build directory we use cmake with
 ```
 cmake .. -DCMAKE_TOOLCHAIN_FILE=..\..\vcpkg\scripts\buildsystems\vcpkg.cmake -DVKVG_LCD_FONT_FILTER=off
 ```
+If you compile vkvg without dependencies, you may run cmake without toolchain: `cmake ..`
 To adjust later compilation options, you may recall cmake command, or use the cmake-gui command.
 ```bash
 cmake-gui ..
 ```
-Now you should have the vkvg.sln and all the projects file into your build directory. You may build the complete solution on the command line with:
+Now you should have the vkvg.sln and all the projects file into your build directory. You may build the complete solution on the command line with (from a visual studio command prompt):
 ```bash
 msbuild vkvg.sln
 ```