Skip to content

Commit

Permalink
Decrease build times by precompiling headers.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hjaltesorgenfrei committed Oct 17, 2022
1 parent b55f36a commit 15f8f46
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 8 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ add_executable(vulkanologi
${CMAKE_CURRENT_SOURCE_DIR}/ext/ImGuizmo/ImGuizmo.h
${CMAKE_CURRENT_SOURCE_DIR}/ext/ImGuizmo/ImGuizmo.cpp
)

add_compile_definitions(VULKAN_HPP_NO_STRUCT_CONSTRUCTORS) # Version 145 at least
target_precompile_headers(vulkanologi PRIVATE ${Vulkan_INCLUDE_DIRS}/vulkan/vulkan.hpp ext/glm/glm/glm.hpp)
target_precompile_headers(vulkanologi PRIVATE src/BehDevice.h)

target_link_libraries(vulkanologi glfw glm tinyobjloader VulkanMemoryAllocator Vulkan::Vulkan)
add_shader(vulkanologi shader.frag)
add_shader(vulkanologi shader.vert)
Expand Down
1 change: 0 additions & 1 deletion src/AssetManager.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#define VULKAN_HPP_NO_STRUCT_CONSTRUCTORS // Version 145 at least
#include "AssetManager.h"

#define STB_IMAGE_IMPLEMENTATION
Expand Down
2 changes: 0 additions & 2 deletions src/AssetManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

#include <map>
#include <span>
#define VULKAN_HPP_NO_STRUCT_CONSTRUCTORS // Version 145 at least

#include <vulkan/vulkan.hpp>

#include "Deletionqueue.h"
Expand Down
1 change: 0 additions & 1 deletion src/BehDevice.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma once

#include "WindowWrapper.h"
#define VULKAN_HPP_NO_STRUCT_CONSTRUCTORS // Version 145 at least
#include <vulkan/vulkan.hpp>
#include <iostream>
#include <map>
Expand Down
1 change: 0 additions & 1 deletion src/BehVkInit.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#define VULKAN_HPP_NO_STRUCT_CONSTRUCTORS // Version 145 at least
#include "BehVkInit.h"

vk::ImageView createImageView(vk::Device device, vk::Image image, vk::Format format, vk::Flags<vk::ImageAspectFlagBits> aspectFlags,
Expand Down
1 change: 0 additions & 1 deletion src/BehVkTypes.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#pragma once

#define VULKAN_HPP_NO_STRUCT_CONSTRUCTORS // Version 145 at least
#include <vulkan/vulkan.hpp>
#include <vk_mem_alloc.h>
#include <glm/glm.hpp>
Expand Down
1 change: 0 additions & 1 deletion src/Mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include <GLFW/glfw3.h>
#include <glm/glm.hpp>

#define VULKAN_HPP_NO_STRUCT_CONSTRUCTORS // Version 145 at least
#include <vulkan/vulkan.hpp>
#include <array>
#include <string>
Expand Down
1 change: 0 additions & 1 deletion src/Renderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#include <memory>

#define VULKAN_HPP_NO_STRUCT_CONSTRUCTORS // Version 145 at least
#include <deque>
#include <functional>
#include <optional>
Expand Down

0 comments on commit 15f8f46

Please sign in to comment.