mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-11 14:43:34 +00:00
enabling pre compiled header
This commit is contained in:
16
Makefile
16
Makefile
@@ -31,13 +31,19 @@ CXX = clang++
|
|||||||
CXXFLAGS = -std=c++20 -fPIC -Wall -Wextra -DSDL_MAIN_HANDLED
|
CXXFLAGS = -std=c++20 -fPIC -Wall -Wextra -DSDL_MAIN_HANDLED
|
||||||
INCLUDES = -I./includes -I./runtime/Includes -I./runtime/Sources -I./third_party
|
INCLUDES = -I./includes -I./runtime/Includes -I./runtime/Sources -I./third_party
|
||||||
|
|
||||||
|
CXXPCHFLAGS =
|
||||||
|
|
||||||
|
PCH = runtime/Includes/PreCompiled.h
|
||||||
|
GCH = runtime/Includes/PreCompiled.h.gch
|
||||||
|
|
||||||
NZSLC = nzslc
|
NZSLC = nzslc
|
||||||
|
|
||||||
ifeq ($(TOOLCHAIN), gcc)
|
ifeq ($(TOOLCHAIN), gcc)
|
||||||
CXX = g++
|
CXX = g++
|
||||||
CXXFLAGS += -Wno-error=cpp
|
CXXFLAGS += -Wno-error=cpp
|
||||||
else
|
else
|
||||||
CXXFLAGS += -Wno-error=#warning
|
CXXFLAGS += -Wno-error=#warning -include-pch $(GCH)
|
||||||
|
CXXPCHFLAGS = -xc++-header
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(OS), Darwin)
|
ifeq ($(OS), Darwin)
|
||||||
@@ -108,7 +114,7 @@ ifeq ($(OBJS_TOTAL), 0) # To avoid division per 0
|
|||||||
endif
|
endif
|
||||||
CURR_OBJ = 0
|
CURR_OBJ = 0
|
||||||
|
|
||||||
$(OBJ_DIR)/%.o: %.cpp
|
$(OBJ_DIR)/%.o: %.cpp $(GCH)
|
||||||
@mkdir -p $(dir $@)
|
@mkdir -p $(dir $@)
|
||||||
@$(eval CURR_OBJ=$(shell echo $$(( $(CURR_OBJ) + 1 ))))
|
@$(eval CURR_OBJ=$(shell echo $$(( $(CURR_OBJ) + 1 ))))
|
||||||
@$(eval PERCENT=$(shell echo $$(( $(CURR_OBJ) * 100 / $(OBJS_TOTAL) ))))
|
@$(eval PERCENT=$(shell echo $$(( $(CURR_OBJ) * 100 / $(OBJS_TOTAL) ))))
|
||||||
@@ -132,6 +138,10 @@ CURR_SPV = 0
|
|||||||
all: _printbuildinfos
|
all: _printbuildinfos
|
||||||
@$(MAKE) $(NAME)
|
@$(MAKE) $(NAME)
|
||||||
|
|
||||||
|
$(GCH):
|
||||||
|
@printf "$(COLOR)($(_BOLD)%3s%%$(_RESET)$(COLOR)) $(_RESET)Compiling $(_BOLD)PreCompiled header$(_RESET)\n" "0"
|
||||||
|
@$(CXX) $(CXXPCHFLAGS) $(INCLUDES) $(PCH) -o $(GCH)
|
||||||
|
|
||||||
$(NAME): $(OBJS)
|
$(NAME): $(OBJS)
|
||||||
@printf "Linking $(_BOLD)$(NAME)$(_RESET)\n"
|
@printf "Linking $(_BOLD)$(NAME)$(_RESET)\n"
|
||||||
@$(CXX) -shared -o $(NAME) $(OBJS) $(LDFLAGS)
|
@$(CXX) -shared -o $(NAME) $(OBJS) $(LDFLAGS)
|
||||||
@@ -151,6 +161,8 @@ shaders: clean-shaders $(SPVS)
|
|||||||
clean:
|
clean:
|
||||||
@$(RM) $(OBJ_DIR)
|
@$(RM) $(OBJ_DIR)
|
||||||
@printf "Cleaned $(_BOLD)$(OBJ_DIR)$(_RESET)\n"
|
@printf "Cleaned $(_BOLD)$(OBJ_DIR)$(_RESET)\n"
|
||||||
|
@$(RM) $(GCH)
|
||||||
|
@printf "Cleaned $(_BOLD)$(GCH)$(_RESET)\n"
|
||||||
|
|
||||||
fclean: clean
|
fclean: clean
|
||||||
@$(RM) $(NAME)
|
@$(RM) $(NAME)
|
||||||
|
|||||||
@@ -83,6 +83,7 @@
|
|||||||
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
|
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
|
||||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||||
#pragma GCC diagnostic ignored "-Wunused-variable"
|
#pragma GCC diagnostic ignored "-Wunused-variable"
|
||||||
|
#pragma GCC diagnostic ignored "-Wunused-function"
|
||||||
#pragma GCC diagnostic ignored "-Wparentheses"
|
#pragma GCC diagnostic ignored "-Wparentheses"
|
||||||
#include <vma.h>
|
#include <vma.h>
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
|
|||||||
@@ -142,7 +142,6 @@ namespace mlx
|
|||||||
void DescriptorPoolManager::Destroy()
|
void DescriptorPoolManager::Destroy()
|
||||||
{
|
{
|
||||||
MLX_PROFILE_FUNCTION();
|
MLX_PROFILE_FUNCTION();
|
||||||
#pragma omp parallel for
|
|
||||||
for(auto& pool : m_pools)
|
for(auto& pool : m_pools)
|
||||||
pool.Destroy();
|
pool.Destroy();
|
||||||
m_pools.clear();
|
m_pools.clear();
|
||||||
|
|||||||
@@ -12,14 +12,16 @@
|
|||||||
#define KVF_REALLOC(p, x) (mlx::MemManager::Get().Realloc(p, x))
|
#define KVF_REALLOC(p, x) (mlx::MemManager::Get().Realloc(p, x))
|
||||||
#define KVF_FREE(x) (mlx::MemManager::Get().Free(x))
|
#define KVF_FREE(x) (mlx::MemManager::Get().Free(x))
|
||||||
|
|
||||||
#if defined(MLX_COMPILER_GCC) || defined(MLX_COMPILER_CLANG)
|
#if defined(MLX_COMPILER_GCC)
|
||||||
#pragma clang diagnostic push
|
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
#pragma clang diagnostic ignored "-Wmissing-field-initializers"
|
|
||||||
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
|
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
|
||||||
#include <kvf.h>
|
#include <kvf.h>
|
||||||
#pragma clang diagnostic pop
|
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
|
#elif defined(MLX_COMPILER_CLANG)
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wmissing-field-initializers"
|
||||||
|
#include <kvf.h>
|
||||||
|
#pragma clang diagnostic pop
|
||||||
#else
|
#else
|
||||||
#include <kvf.h>
|
#include <kvf.h>
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user