diff options
Diffstat (limited to '.ci/Makefile')
-rw-r--r-- | .ci/Makefile | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/.ci/Makefile b/.ci/Makefile index 9c82fca..a30414c 100644 --- a/.ci/Makefile +++ b/.ci/Makefile @@ -1,5 +1,6 @@ -INCLUDE_DIRS := . ../libdrm/include/drm include ./.ci/android_headers ./tests/test_include +BASE_DIR:=../aospless + SYSTEM_INCLUDE_DIRS := /usr/include/libdrm CLANG := clang++-15 @@ -7,12 +8,17 @@ CLANG_TIDY := clang-tidy-15 OUT_DIR := /tmp/drm_hwcomposer/build SRC_DIR := . -CXXFLAGS := -fPIC -Wall -Wextra -Werror -D__ANDROID_API__=31 +CXXFLAGS := -Wall -Wextra -Werror CXXFLAGS += -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS CXXFLAGS += -fvisibility-inlines-hidden -std=gnu++17 -DHWC2_USE_CPP11 -DHWC2_INCLUDE_STRINGIFICATION -fno-rtti -SKIP_FILES := \ - bufferinfo/BufferInfoMapperMetadata.cpp +CXXARGS := $(shell cat $(BASE_DIR)/build_flags/sharedlib.cppflags) +CXXARGS := $(subst [BASE_DIR],$(BASE_DIR),$(CXXARGS)) +# clang-tidy doesn't like -mcpu=xxx flag +CXXARGS := $(patsubst -mcpu=%,,$(CXXARGS)) +# TODO: build aospless with gtest enabled and remove line below +CXXARGS := $(subst -nostdlibinc,,$(CXXARGS)) +CXXARGS += -I. -I./tests/test_include $(CXXFLAGS) TIDY_FILES_OVERRIDE := \ bufferinfo/legacy/BufferInfoImagination.cpp:COARSE \ @@ -90,15 +96,14 @@ DEPS := $(patsubst %.cpp,$(OUT_DIR)/%.d,$(BUILD_FILES)) build: $(OBJ) -CXXARGS := $(foreach dir,$(INCLUDE_DIRS),-I$(SRC_DIR)/$(dir)) $(foreach dir,$(SYSTEM_INCLUDE_DIRS),-I$(dir)) $(CXXFLAGS) - $(OUT_DIR)/%.o: $(SRC_DIR)/%.cpp - mkdir -p $(dir $@) - $(CLANG) $< $(CXXARGS) -c -o $@ + @mkdir -p $(dir $@) + @echo "CC $<" + @$(CLANG) $< $(CXXARGS) -c -o $@ $(OUT_DIR)/%.d: $(SRC_DIR)/%.cpp - mkdir -p $(dir $@) - $(CLANG) $(CXXARGS) $< -MM -MT $(OUT_DIR)/$(patsubst %.cpp,%.o,$<) -o $@ + @mkdir -p $(dir $@) + @$(CLANG) $(CXXARGS) $< -MM -MT $(OUT_DIR)/$(patsubst %.cpp,%.o,$<) -o $@ # TIDY TIDY_FILES_AUTO := $(shell find -L $(SRC_DIR) -not -path '*/\.*' -not -path '*/tests/test_include/*' \( -path '*.cpp' -o -path '*.h' \)) @@ -123,7 +128,7 @@ TIDY_ARGS_COARSE := --checks="$(subst $(space),$(comma),$(strip $(TIDY_CHECKS_CO define process-tidy _TARG := $(OUT_DIR)/$1.tidy.ts -_DEP := $(SRC_DIR)/$1 +_DEP := $1 TIDY_DEPS += $(_TARG) @@ -137,9 +142,10 @@ $$(_TARG): _DEP := $$(_DEP) $$(_TARG): _TARG := $$(_TARG) $$(_TARG): TIDY_ARGS := $$(TIDY_ARGS) $$(_TARG): $$(_DEP) - mkdir -p $$(dir $$(_TARG)) - $$(CLANG_TIDY) $$(_DEP) $$(TIDY_ARGS) -- -x c++ $$(CXXARGS) -Wno-pragma-once-outside-header - touch $$(_TARG) + @mkdir -p $$(dir $$(_TARG)) + @echo "TIDY $$<" + @$$(CLANG_TIDY) $$(_DEP) $$(TIDY_ARGS) --quiet -- -x c++ $$(CXXARGS) -Wno-pragma-once-outside-header + @touch $$(_TARG) endef |