Skip to content

Commit

Permalink
Fix meson
Browse files Browse the repository at this point in the history
  • Loading branch information
MarijnS95 committed Oct 25, 2022
1 parent 36ca6a4 commit 4f92aa8
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions android/mesa3d_cross.mk
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ MESA3D_GLES_BINS := \
$($(M_TARGET_PREFIX)MESA3D_LIBGLAPI_BIN) \

MESON_GEN_NINJA := \
cd $(MESON_OUT_DIR) && PATH=/usr/bin:/usr/local/bin:$$PATH meson ./build \
PATH=/usr/bin:/usr/local/bin:$$PATH meson $(MESON_OUT_DIR)/build $(MESA3D_TOP) \
--cross-file $(call relative-to-absolute,$(MESON_GEN_DIR))/aosp_cross \
--buildtype=release \
-Ddri-search-path=/vendor/$(MESA3D_LIB_DIR)/dri \
Expand All @@ -91,7 +91,7 @@ MESON_GEN_NINJA := \
-Dgbm=enabled \
-Degl=enabled \
-Dcpp_rtti=false \
-Dlmsensors=disabled \
-Dlmsensors=disabled

MESON_BUILD := PATH=/usr/bin:/bin:/sbin:$$PATH ninja -C $(MESON_OUT_DIR)/build

Expand Down Expand Up @@ -180,9 +180,15 @@ define m-lld-flags-cleaned
$(m-lld-flags))))))))
endef

# $(warning global $(PRIVATE_TARGET_GLOBAL_CFLAGS))
# $(warning clang $(CLANG_TARGET_GLOBAL_CFLAGS))
# $(warning $(PRIVATE_ARM_CFLAGS))
# $(warning $(PRIVATE_TARGET_GLOBAL_LDFLAGS))
# $(warning $(CLANG_TARGET_GLOBAL_LDFLAGS))

define m-cpp-flags
$(PRIVATE_TARGET_GLOBAL_CFLAGS) \
$(PRIVATE_TARGET_GLOBAL_CPPFLAGS) \
$(CLANG_TARGET_GLOBAL_CFLAGS) \
$(CLANG_TARGET_GLOBAL_CPPFLAGS) \
$(PRIVATE_ARM_CFLAGS) \
$(PRIVATE_RTTI_FLAG) \
$(PRIVATE_CFLAGS) \
Expand All @@ -193,8 +199,8 @@ define m-cpp-flags
endef

define m-c-flags
$(PRIVATE_TARGET_GLOBAL_CFLAGS) \
$(PRIVATE_TARGET_GLOBAL_CONLYFLAGS) \
$(CLANG_TARGET_GLOBAL_CFLAGS) \
$(CLANG_TARGET_GLOBAL_CONLYFLAGS) \
$(PRIVATE_ARM_CFLAGS) \
$(PRIVATE_CFLAGS) \
$(PRIVATE_CONLYFLAGS) \
Expand Down Expand Up @@ -236,17 +242,18 @@ $(MESON_GEN_FILES_TARGET): MESON_GEN_DIR:=$(MESON_GEN_DIR)
$(MESON_GEN_FILES_TARGET): $(sort $(shell find -L $(MESA3D_TOP) -not -path '*/\.*'))
mkdir -p $(dir $@)
echo -e "[properties]\n" \
"c_args = [$(foreach flag,$(call filter-c-flags,$(m-c-flags)),'$(flag)', ) \
$(foreach inc,$(nospace-includes),'$(call abs-include,$(inc))', )'']\n" \
"cpp_args = [$(foreach flag,$(call filter-c-flags,$(m-cpp-flags)),'$(flag)', ) \
$(foreach inc,$(nospace-includes),'$(call abs-include,$(inc))', )'']\n" \
"needs_exe_wrapper = true\n" \
"[built-in options]\n" \
"c_args = [$(foreach flag,$(call filter-c-flags,$(m-c-flags)),'$(flag)', ) \
$(foreach inc,$(nospace-includes),'$(call abs-include,$(inc))', )'']\n" \
"cpp_args = [$(foreach flag,$(call filter-c-flags,$(m-cpp-flags)),'$(flag)', ) \
$(foreach inc,$(nospace-includes),'$(call abs-include,$(inc))', )'']\n" \
"c_link_args = [$(foreach flag, $(m-lld-flags-cleaned),'$(flag)',)'']\n" \
"cpp_link_args = [$(foreach flag, $(m-lld-flags-cleaned),'$(flag)',)'']\n" \
"needs_exe_wrapper = true\n" \
"[binaries]\n" \
"ar = '$(AOSP_ABSOLUTE_PATH)/$($($(M_TARGET_PREFIX))TARGET_AR)'\n" \
"c = [$(foreach arg,$(PRIVATE_CC),'$(subst prebuilts/,$(AOSP_ABSOLUTE_PATH)/prebuilts/,$(arg))',)'']\n" \
"cpp = [$(foreach arg,$(PRIVATE_CXX),'$(subst prebuilts/,$(AOSP_ABSOLUTE_PATH)/prebuilts/,$(arg))',)'']\n" \
"c = '$(AOSP_ABSOLUTE_PATH)/$(firstword $(PRIVATE_CC))'\n" \
"cpp = '$(AOSP_ABSOLUTE_PATH)/$(firstword $(PRIVATE_CXX))'\n" \
"c_ld = 'lld'\n" \
"cpp_ld = 'lld'\n\n" \
"pkgconfig = ['env', 'PKG_CONFIG_LIBDIR=' + '$(call relative-to-absolute,$(MESON_GEN_DIR))', '/usr/bin/pkg-config']\n\n" \
Expand All @@ -267,9 +274,6 @@ $(MESON_OUT_DIR)/.build.timestamp: $(MESON_GEN_FILES_TARGET) $(link_deps)
rm -rf $(dir $@)
mkdir -p $(dir $@)
mkdir -p $(dir $@)/build
# Meson will update timestamps in sources directory, continuously retriggering the build
# even if nothing changed. Copy sources into intermediate dir to avoid this effect.
cp -r $(MESA3D_TOP)/* $(dir $@)
ifneq ($(MESON_GEN_LLVM_STUB),)
mkdir -p $(dir $@)/subprojects/llvm/
echo -e "project('llvm', 'cpp', version : '$(MESON_LLVM_VERSION)')\n" \
Expand Down

0 comments on commit 4f92aa8

Please sign in to comment.