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
|
||||
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
|
||||
|
||||
ifeq ($(TOOLCHAIN), gcc)
|
||||
CXX = g++
|
||||
CXXFLAGS += -Wno-error=cpp
|
||||
else
|
||||
CXXFLAGS += -Wno-error=#warning
|
||||
CXXFLAGS += -Wno-error=#warning -include-pch $(GCH)
|
||||
CXXPCHFLAGS = -xc++-header
|
||||
endif
|
||||
|
||||
ifeq ($(OS), Darwin)
|
||||
@@ -108,7 +114,7 @@ ifeq ($(OBJS_TOTAL), 0) # To avoid division per 0
|
||||
endif
|
||||
CURR_OBJ = 0
|
||||
|
||||
$(OBJ_DIR)/%.o: %.cpp
|
||||
$(OBJ_DIR)/%.o: %.cpp $(GCH)
|
||||
@mkdir -p $(dir $@)
|
||||
@$(eval CURR_OBJ=$(shell echo $$(( $(CURR_OBJ) + 1 ))))
|
||||
@$(eval PERCENT=$(shell echo $$(( $(CURR_OBJ) * 100 / $(OBJS_TOTAL) ))))
|
||||
@@ -132,6 +138,10 @@ CURR_SPV = 0
|
||||
all: _printbuildinfos
|
||||
@$(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)
|
||||
@printf "Linking $(_BOLD)$(NAME)$(_RESET)\n"
|
||||
@$(CXX) -shared -o $(NAME) $(OBJS) $(LDFLAGS)
|
||||
@@ -151,6 +161,8 @@ shaders: clean-shaders $(SPVS)
|
||||
clean:
|
||||
@$(RM) $(OBJ_DIR)
|
||||
@printf "Cleaned $(_BOLD)$(OBJ_DIR)$(_RESET)\n"
|
||||
@$(RM) $(GCH)
|
||||
@printf "Cleaned $(_BOLD)$(GCH)$(_RESET)\n"
|
||||
|
||||
fclean: clean
|
||||
@$(RM) $(NAME)
|
||||
|
||||
@@ -83,6 +83,7 @@
|
||||
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#pragma GCC diagnostic ignored "-Wunused-variable"
|
||||
#pragma GCC diagnostic ignored "-Wunused-function"
|
||||
#pragma GCC diagnostic ignored "-Wparentheses"
|
||||
#include <vma.h>
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
@@ -142,7 +142,6 @@ namespace mlx
|
||||
void DescriptorPoolManager::Destroy()
|
||||
{
|
||||
MLX_PROFILE_FUNCTION();
|
||||
#pragma omp parallel for
|
||||
for(auto& pool : m_pools)
|
||||
pool.Destroy();
|
||||
m_pools.clear();
|
||||
|
||||
@@ -12,14 +12,16 @@
|
||||
#define KVF_REALLOC(p, x) (mlx::MemManager::Get().Realloc(p, x))
|
||||
#define KVF_FREE(x) (mlx::MemManager::Get().Free(x))
|
||||
|
||||
#if defined(MLX_COMPILER_GCC) || defined(MLX_COMPILER_CLANG)
|
||||
#pragma clang diagnostic push
|
||||
#if defined(MLX_COMPILER_GCC)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wmissing-field-initializers"
|
||||
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
|
||||
#include <kvf.h>
|
||||
#pragma clang 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
|
||||
#include <kvf.h>
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user