Make it work with flake.nix
This commit is contained in:
@@ -12,28 +12,35 @@ PCH_RELEASE := $(OBJ_DIR)/release/pch.h.gch
|
||||
GENERATED_HEADER := $(INCLUDE_DIR)/scripting/ruby_compiled.h
|
||||
|
||||
CCACHE := ccache
|
||||
CXX := $(CCACHE) clang++
|
||||
CC := $(CCACHE) musl-clang
|
||||
|
||||
CXX ?= x86_64-unknown-linux-musl-g++
|
||||
CC ?= x86_64-unknown-linux-musl-gcc
|
||||
|
||||
CXX := $(CCACHE) $(CXX)
|
||||
CC := $(CCACHE) $(CC)
|
||||
|
||||
CFLAGS_DEBUG :=\
|
||||
-std=c++20 -Wall -Wextra \
|
||||
-std=c++20 -Wall -Wextra -static \
|
||||
-O0 -fno-inline -gsplit-dwarf \
|
||||
-g -fno-omit-frame-pointer \
|
||||
-Wno-unused-command-line-argument \
|
||||
-I./include -I./libs -I./libs/mruby/include
|
||||
-I./include -I./libs -I./libs/mruby/include -I./libs/json/include -I./libs/mruby/build/host/include
|
||||
|
||||
# C_SANITIZER := -fsanitize=address
|
||||
|
||||
CFLAGS_RELEASE :=\
|
||||
-static --target=x86_64-linux-musl \
|
||||
-std=c++20 -O3 -march=x86-64 -mtune=generic \
|
||||
-fno-rtti \
|
||||
-static \
|
||||
-std=c++20 -O3 -march=x86-64 -mtune=generic -fno-rtti \
|
||||
-ffast-math -flto=thin \
|
||||
-fvisibility=hidden \
|
||||
-fomit-frame-pointer -DNDEBUG -s \
|
||||
-mllvm -vectorize-loops \
|
||||
-Wno-unused-command-line-argument \
|
||||
-I./include -I./libs -I./libs/mruby/include
|
||||
-I./include -I./libs -I./libs/mruby/include -I./libs/json/include -I./libs/mruby/build/host/include
|
||||
|
||||
PCRE_CFLAGS := $(shell pkg-config --cflags libpcre2-8)
|
||||
PCRE_LIBS := $(shell pkg-config --static --libs libpcre2-8)
|
||||
|
||||
CFLAGS_DEBUG += $(PCRE_CFLAGS)
|
||||
CFLAGS_RELEASE += $(PCRE_CFLAGS)
|
||||
|
||||
PCH_CFLAGS_DEBUG := $(CFLAGS_DEBUG) -x c++-header
|
||||
PCH_CFLAGS_RELEASE := $(CFLAGS_RELEASE) -x c++-header
|
||||
@@ -43,13 +50,15 @@ UNICODE_SRC := $(wildcard libs/unicode_width/*.c)
|
||||
UNICODE_OBJ_DEBUG := $(patsubst libs/unicode_width/%.c,$(OBJ_DIR)/debug/unicode_width/%.o,$(UNICODE_SRC))
|
||||
UNICODE_OBJ_RELEASE := $(patsubst libs/unicode_width/%.c,$(OBJ_DIR)/release/unicode_width/%.o,$(UNICODE_SRC))
|
||||
|
||||
LIBS_RELEASE := \
|
||||
libs/libgrapheme/libgrapheme.a ./libs/mruby/build/host/lib/libmruby.a \
|
||||
-Wl,-Bstatic,--gc-sections -lpcre2-8
|
||||
|
||||
LIBS_DEBUG := \
|
||||
libs/libgrapheme/libgrapheme.a ./libs/mruby/build/host/lib/libmruby.a \
|
||||
-Wl,-Bdynamic -lpcre2-8
|
||||
libs/libgrapheme/libgrapheme.a \
|
||||
./libs/mruby/build/host/lib/libmruby.a \
|
||||
$(PCRE_LIBS)
|
||||
|
||||
LIBS_RELEASE := \
|
||||
libs/libgrapheme/libgrapheme.a \
|
||||
./libs/mruby/build/host/lib/libmruby.a \
|
||||
$(PCRE_LIBS)
|
||||
|
||||
SRC := $(wildcard $(SRC_DIR)/**/*.cc) $(wildcard $(SRC_DIR)/*.cc)
|
||||
OBJ_DEBUG := $(patsubst $(SRC_DIR)/%.cc,$(OBJ_DIR)/debug/%.o,$(SRC))
|
||||
|
||||
Reference in New Issue
Block a user