From f6bc37713d2687f808108ddc12f08e190d5112e7 Mon Sep 17 00:00:00 2001 From: Tomoyuki Sakurai Date: Mon, 21 Oct 2024 18:14:29 +0700 Subject: [PATCH] bugfix: fix ccache issue with cmake add empty plist for filling ccache cache --- devel/esp-llvm-embedded-toolchain/Makefile | 14 +++++++++++++- devel/esp-llvm-embedded-toolchain/pkg-plist.clang | 0 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 devel/esp-llvm-embedded-toolchain/pkg-plist.clang diff --git a/devel/esp-llvm-embedded-toolchain/Makefile b/devel/esp-llvm-embedded-toolchain/Makefile index 854ebe3..c824aab 100644 --- a/devel/esp-llvm-embedded-toolchain/Makefile +++ b/devel/esp-llvm-embedded-toolchain/Makefile @@ -96,6 +96,7 @@ CMAKE_ARGS= \ # our own CMAKE_ARGS CMAKE_ARGS+= \ -DCLANG_REPOSITORY_STRING=${WWW} + # TODO are gcc13 and g++13 necessary? BINARY_ALIAS= gcc13=${CC} g++13=${CXX} \ ${ESP_ARCH}-unknown-freebsd-gcc=${ESP_ARCH}-portbld-freebsd${OSREL}-${CC} \ @@ -175,6 +176,15 @@ CMAKE_ARGS= \ -B ${CONFIGURE_WRKSRC} .endif +.include + +# work around CMAKE/CCACHE flaw (cmake stomps over ccache) +# obtained from graphics/darktable. +.if "${WITH_CCACHE_BUILD}" == "yes" && !defined(NO_CCACHE) +CMAKE_ARGS+= -DCMAKE_C_COMPILER_LAUNCHER=${CCACHE_BIN} \ + -DCMAKE_CXX_COMPILER_LAUNCHER=${CCACHE_BIN} +.endif + pre-configure: @${REINPLACE_CMD} -e 's|%%ESP_TMPDIR%%|${ESP_TMPDIR}|g' \ ${WRKSRC}/cmake/esp-gnu-components.cmake @@ -199,8 +209,10 @@ pre-build: # TODO should be removed do-install: +.if ${INSTALL_TARGET} != clang (cd ${INSTALL_WRKSRC} && ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${FAKEROOT} \ ${MAKE_CMD} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${INSTALL_TARGET}) +.endif post-install: .for F in ${ESP_STRIP_FILES} @@ -208,4 +220,4 @@ post-install: @${RM} ${STAGEDIR}${ESP_PREFIX}/bin/*.cfg .endfor -.include +.include diff --git a/devel/esp-llvm-embedded-toolchain/pkg-plist.clang b/devel/esp-llvm-embedded-toolchain/pkg-plist.clang new file mode 100644 index 0000000..e69de29