diff mbox series

[PATCHv3,2/2] tools/zstd: compile with cmake

Message ID 20210121045458.2210790-2-rosenp@gmail.com
State Accepted
Delegated to: Paul Spooren
Headers show
Series [PATCHv3,1/2] tools/zstd: update to 1.4.8 | expand

Commit Message

Rosen Penev Jan. 21, 2021, 4:54 a.m. UTC
It's faster and more reliable.

Removed ccache cmake build dependency as it's now implicit.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 v3: converted to use CMake
 tools/Makefile      | 3 ++-
 tools/zstd/Makefile | 9 +++++++--
 2 files changed, 9 insertions(+), 3 deletions(-)

Comments

Paul Spooren Jan. 31, 2021, 2:04 a.m. UTC | #1
On Wed Jan 20, 2021 at 6:54 PM HST, Rosen Penev wrote:
> It's faster and more reliable.
>
> Removed ccache cmake build dependency as it's now implicit.
>
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
> ---
> v3: converted to use CMake
> tools/Makefile | 3 ++-
> tools/zstd/Makefile | 9 +++++++--
> 2 files changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/tools/Makefile b/tools/Makefile
> index 09fe340e6c..a2665dbc9a 100644
> --- a/tools/Makefile
> +++ b/tools/Makefile
> @@ -72,6 +72,7 @@ $(curdir)/sdcc/compile := $(curdir)/bison/compile
> $(curdir)/squashfs/compile := $(curdir)/lzma-old/compile
> $(curdir)/squashfskit4/compile := $(curdir)/xz/compile
> $(curdir)/zlib/compile
> $(curdir)/zlib/compile := $(curdir)/cmake/compile
> +$(curdir)/zstd/compile := $(curdir)/cmake/compile
>  
> ifneq ($(HOST_OS),Linux)
> $(curdir)/squashfskit4/compile += $(curdir)/coreutils/compile
> @@ -81,7 +82,7 @@ endif
> ifneq ($(CONFIG_CCACHE)$(CONFIG_SDK),)
> $(foreach tool, $(filter-out xz zstd patch pkgconf libressl
> cmake,$(tools-y)), $(eval $(curdir)/$(tool)/compile +=
> $(curdir)/ccache/compile))
> tools-y += ccache
> -$(curdir)/ccache/compile := $(curdir)/cmake/compile
> $(curdir)/zstd/compile
> +$(curdir)/ccache/compile := $(curdir)/zstd/compile
> endif
>  
> # in case there is no patch tool on the host we need to make patch tool
> a
> diff --git a/tools/zstd/Makefile b/tools/zstd/Makefile
> index 1107c0d92c..a0106f15f2 100644
> --- a/tools/zstd/Makefile
> +++ b/tools/zstd/Makefile
> @@ -11,11 +11,16 @@ PKG_LICENSE:=BSD-3-Clause
> PKG_LICENSE_FILES:=LICENSE
> PKG_CPE_ID:=cpe:/a:facebook:zstandard
>  
> +CMAKE_SOURCE_SUBDIR:=build/cmake
> HOST_BUILD_PARALLEL:=1
>  
> include $(INCLUDE_DIR)/host-build.mk
> +include $(INCLUDE_DIR)/cmake.mk
>  
> -HOSTCC := $(HOSTCC_NOCACHE)
> -HOST_MAKE_FLAGS = PREFIX=$(HOST_BUILD_PREFIX) HAVE_ZLIB=0 HAVE_LZMA=0
> HAVE_LZ4=0
> +CMAKE_HOST_OPTIONS += \
> + -DBUILD_TESTING=OFF \
> + -DCMAKE_C_COMPILER_LAUNCHER="" \
> + -DCMAKE_C_COMPILER=$(HOSTCC_NOCACHE) \
> + -DZSTD_LEGACY_SUPPORT=OFF

These option changes look somewhat different, do they still result in
the same output?
>  
> $(eval $(call HostBuild))
> --
> 2.29.2
>
>
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Rosen Penev Jan. 31, 2021, 2:29 a.m. UTC | #2
On Sat, Jan 30, 2021 at 6:04 PM Paul Spooren <mail@aparcar.org> wrote:
>
> On Wed Jan 20, 2021 at 6:54 PM HST, Rosen Penev wrote:
> > It's faster and more reliable.
> >
> > Removed ccache cmake build dependency as it's now implicit.
> >
> > Signed-off-by: Rosen Penev <rosenp@gmail.com>
> > ---
> > v3: converted to use CMake
> > tools/Makefile | 3 ++-
> > tools/zstd/Makefile | 9 +++++++--
> > 2 files changed, 9 insertions(+), 3 deletions(-)
> >
> > diff --git a/tools/Makefile b/tools/Makefile
> > index 09fe340e6c..a2665dbc9a 100644
> > --- a/tools/Makefile
> > +++ b/tools/Makefile
> > @@ -72,6 +72,7 @@ $(curdir)/sdcc/compile := $(curdir)/bison/compile
> > $(curdir)/squashfs/compile := $(curdir)/lzma-old/compile
> > $(curdir)/squashfskit4/compile := $(curdir)/xz/compile
> > $(curdir)/zlib/compile
> > $(curdir)/zlib/compile := $(curdir)/cmake/compile
> > +$(curdir)/zstd/compile := $(curdir)/cmake/compile
> >
> > ifneq ($(HOST_OS),Linux)
> > $(curdir)/squashfskit4/compile += $(curdir)/coreutils/compile
> > @@ -81,7 +82,7 @@ endif
> > ifneq ($(CONFIG_CCACHE)$(CONFIG_SDK),)
> > $(foreach tool, $(filter-out xz zstd patch pkgconf libressl
> > cmake,$(tools-y)), $(eval $(curdir)/$(tool)/compile +=
> > $(curdir)/ccache/compile))
> > tools-y += ccache
> > -$(curdir)/ccache/compile := $(curdir)/cmake/compile
> > $(curdir)/zstd/compile
> > +$(curdir)/ccache/compile := $(curdir)/zstd/compile
> > endif
> >
> > # in case there is no patch tool on the host we need to make patch tool
> > a
> > diff --git a/tools/zstd/Makefile b/tools/zstd/Makefile
> > index 1107c0d92c..a0106f15f2 100644
> > --- a/tools/zstd/Makefile
> > +++ b/tools/zstd/Makefile
> > @@ -11,11 +11,16 @@ PKG_LICENSE:=BSD-3-Clause
> > PKG_LICENSE_FILES:=LICENSE
> > PKG_CPE_ID:=cpe:/a:facebook:zstandard
> >
> > +CMAKE_SOURCE_SUBDIR:=build/cmake
> > HOST_BUILD_PARALLEL:=1
> >
> > include $(INCLUDE_DIR)/host-build.mk
> > +include $(INCLUDE_DIR)/cmake.mk
> >
> > -HOSTCC := $(HOSTCC_NOCACHE)
> > -HOST_MAKE_FLAGS = PREFIX=$(HOST_BUILD_PREFIX) HAVE_ZLIB=0 HAVE_LZMA=0
> > HAVE_LZ4=0
> > +CMAKE_HOST_OPTIONS += \
> > + -DBUILD_TESTING=OFF \
> > + -DCMAKE_C_COMPILER_LAUNCHER="" \
> > + -DCMAKE_C_COMPILER=$(HOSTCC_NOCACHE) \
> > + -DZSTD_LEGACY_SUPPORT=OFF
>
> These option changes look somewhat different, do they still result in
> the same output?

The HOSTCC changes are because ccache depends on zstd.

ZSTD_LEGACY_SUPPORT , ZSTD_LZ4_SUPPORT, ZSTD_LZMA_SUPPORT, and
ZSTD_ZLIB_SUPPORT all default to off. That being said, whether or not
it is built with those options doesn't really matter as this is a tool
and not a package.
> >
> > $(eval $(call HostBuild))
> > --
> > 2.29.2
> >
> >
> > _______________________________________________
> > openwrt-devel mailing list
> > openwrt-devel@lists.openwrt.org
> > https://lists.openwrt.org/mailman/listinfo/openwrt-devel
>
diff mbox series

Patch

diff --git a/tools/Makefile b/tools/Makefile
index 09fe340e6c..a2665dbc9a 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -72,6 +72,7 @@  $(curdir)/sdcc/compile := $(curdir)/bison/compile
 $(curdir)/squashfs/compile := $(curdir)/lzma-old/compile
 $(curdir)/squashfskit4/compile := $(curdir)/xz/compile $(curdir)/zlib/compile
 $(curdir)/zlib/compile := $(curdir)/cmake/compile
+$(curdir)/zstd/compile := $(curdir)/cmake/compile
 
 ifneq ($(HOST_OS),Linux)
   $(curdir)/squashfskit4/compile += $(curdir)/coreutils/compile
@@ -81,7 +82,7 @@  endif
 ifneq ($(CONFIG_CCACHE)$(CONFIG_SDK),)
 $(foreach tool, $(filter-out xz zstd patch pkgconf libressl cmake,$(tools-y)), $(eval $(curdir)/$(tool)/compile += $(curdir)/ccache/compile))
 tools-y += ccache
-$(curdir)/ccache/compile := $(curdir)/cmake/compile $(curdir)/zstd/compile
+$(curdir)/ccache/compile := $(curdir)/zstd/compile
 endif
 
 # in case there is no patch tool on the host we need to make patch tool a
diff --git a/tools/zstd/Makefile b/tools/zstd/Makefile
index 1107c0d92c..a0106f15f2 100644
--- a/tools/zstd/Makefile
+++ b/tools/zstd/Makefile
@@ -11,11 +11,16 @@  PKG_LICENSE:=BSD-3-Clause
 PKG_LICENSE_FILES:=LICENSE
 PKG_CPE_ID:=cpe:/a:facebook:zstandard
 
+CMAKE_SOURCE_SUBDIR:=build/cmake
 HOST_BUILD_PARALLEL:=1
 
 include $(INCLUDE_DIR)/host-build.mk
+include $(INCLUDE_DIR)/cmake.mk
 
-HOSTCC := $(HOSTCC_NOCACHE)
-HOST_MAKE_FLAGS = PREFIX=$(HOST_BUILD_PREFIX) HAVE_ZLIB=0 HAVE_LZMA=0 HAVE_LZ4=0
+CMAKE_HOST_OPTIONS += \
+	-DBUILD_TESTING=OFF \
+	-DCMAKE_C_COMPILER_LAUNCHER="" \
+	-DCMAKE_C_COMPILER=$(HOSTCC_NOCACHE) \
+	-DZSTD_LEGACY_SUPPORT=OFF
 
 $(eval $(call HostBuild))