build: rationalise generated header include paths

This commit is contained in:
Danny Robson 2019-06-20 11:38:55 +10:00
parent 27d65f8aed
commit 2ab194cdc0
6 changed files with 21 additions and 19 deletions

View File

@ -14,7 +14,8 @@ endif ()
###############################################################################
set (GENERATED_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/cruft/vk/")
set (GENERATED_BASE "${CMAKE_CURRENT_BINARY_DIR}/prefix")
set (GENERATED_PREFIX "${GENERATED_BASE}/cruft/vk/")
file (MAKE_DIRECTORY "${GENERATED_PREFIX}/load")
file (MAKE_DIRECTORY "${GENERATED_PREFIX}/tools")
@ -89,7 +90,7 @@ foreach (lib vulkan cruft-vk-load)
target_include_directories (${lib}
PUBLIC
"${CMAKE_CURRENT_SOURCE_DIR}"
"${CMAKE_CURRENT_BINARY_DIR}"
"${GENERATED_PREFIX}"
"${CMAKE_CURRENT_SOURCE_DIR}/specs/include/vulkan"
)

View File

@ -7,8 +7,8 @@
*/
#include <cruft/vk/load/vtable.hpp>
#include <cruft/vk/load/vendor.hpp>
#include "load/vtable.hpp"
#include "load/vendor.hpp"
#include <vector>

View File

@ -1,7 +1,7 @@
#pragma once
#include <cruft/vk/vk.hpp>
#include <cruft/vk/load/vtable.hpp>
#include "vk.hpp"
#include "load/vtable.hpp"
#include <cruft/util/library.hpp>
#include <cruft/util/std.hpp>

View File

@ -1 +1 @@
#include <cruft/vk/load/vtable.hpp>
#include "load/vtable.hpp"

View File

@ -9,12 +9,12 @@
#include <cruft/util/iterator/infix.hpp>
#include <cruft/vk/load/ostream.hpp>
#include <cruft/vk/load/vtable.hpp>
#include "load/ostream.hpp"
#include "load/vtable.hpp"
#include <cruft/vk/instance.hpp>
#include <cruft/vk/physical_device.hpp>
#include <cruft/vk/ostream.hpp>
#include "instance.hpp"
#include "physical_device.hpp"
#include "ostream.hpp"
#include <iostream>

View File

@ -802,7 +802,7 @@ def write_load(dst: TextIO, q: List[Type], reg: Registry):
dst.write(f"""
#pragma once
#include <cruft/vk/vk.hpp>
#include "vk.hpp"
#include <cruft/util/preprocessor.hpp>
@ -845,9 +845,9 @@ def write_load(dst: TextIO, q: List[Type], reg: Registry):
# -----------------------------------------------------------------------------
def write_dispatch(dst: TextIO, q: List[Type], reg: Registry):
dst.write("""
#include <cruft/vk/vk.hpp>
#include <cruft/vk/load/vtable.hpp>
#include <cruft/vk/load/dispatch.hpp>
#include "vk.hpp"
#include "load/vtable.hpp"
#include "load/dispatch.hpp"
#include <cruft/util/debug/panic.hpp>
@ -993,9 +993,10 @@ def write_dispatch(dst: TextIO, q: List[Type], reg: Registry):
def write_trace(dst: TextIO, q: List[Type], reg: Registry):
dst.write("""
#include <cruft/vk/vk.hpp>
#include <cruft/vk/load/vtable.hpp>
#include <cruft/vk/ostream.hpp>
#include "vk.hpp"
#include "load/vtable.hpp"
#include "ostream.hpp"
#include <iostream>
#include <dlfcn.h>
#include <cstring>