diff options
author | fuzzard <fuzzard@users.noreply.github.com> | 2022-04-25 07:32:32 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-25 07:32:32 +1000 |
commit | bb2f79f6b82e2215dd643bd6c00773826a2682c5 (patch) | |
tree | 0f77ca7c8d35ceebece0c2ee7e8d461d3b3bde66 /tools/depends/target | |
parent | 7112fa08f659c2923ef6809378df5d857fda9f45 (diff) | |
parent | 8f0e47e3ce7e0c188c5548789b2cea18f0c8484d (diff) |
Merge pull request #21278 from fuzzard/depends_libpng
[tools/depends][target] libpng use cmake build system
Diffstat (limited to 'tools/depends/target')
-rw-r--r-- | tools/depends/target/libpng/LIBPNG-VERSION | 5 | ||||
-rw-r--r-- | tools/depends/target/libpng/Makefile | 49 |
2 files changed, 31 insertions, 23 deletions
diff --git a/tools/depends/target/libpng/LIBPNG-VERSION b/tools/depends/target/libpng/LIBPNG-VERSION new file mode 100644 index 0000000000..c67b9d40ef --- /dev/null +++ b/tools/depends/target/libpng/LIBPNG-VERSION @@ -0,0 +1,5 @@ +LIBNAME=libpng +VERSION=1.6.37 +ARCHIVE=$(LIBNAME)-$(VERSION).tar.gz +SHA512=2ce2b855af307ca92a6e053f521f5d262c36eb836b4810cb53c809aa3ea2dcc08f834aee0ffd66137768a54397e28e92804534a74abb6fc9f6f3127f14c9c338 +BYPRODUCT=libpng.a diff --git a/tools/depends/target/libpng/Makefile b/tools/depends/target/libpng/Makefile index 9962f78edb..4e4def73bc 100644 --- a/tools/depends/target/libpng/Makefile +++ b/tools/depends/target/libpng/Makefile @@ -1,37 +1,40 @@ -include ../../Makefile.include -DEPS = ../../Makefile.include Makefile ../../download-files.include - -# lib name, version -LIBNAME=libpng -VERSION=1.6.37 -SOURCE=$(LIBNAME)-$(VERSION) -ARCHIVE=$(SOURCE).tar.gz -SHA512=2ce2b855af307ca92a6e053f521f5d262c36eb836b4810cb53c809aa3ea2dcc08f834aee0ffd66137768a54397e28e92804534a74abb6fc9f6f3127f14c9c338 -include ../../download-files.include +include ../../Makefile.include LIBPNG-VERSION ../../download-files.include +DEPS = ../../Makefile.include Makefile LIBPNG-VERSION ../../download-files.include # configuration settings -CONFIGURE=cp -f $(CONFIG_SUB) $(CONFIG_GUESS) .; \ - ./configure --prefix=$(PREFIX) --disable-shared - -LIBDYLIB=$(PLATFORM)/.libs/$(LIBNAME)16.a +CMAKE_OPTIONS=-DPNG_SHARED=OFF \ + -DPNG_STATIC=ON \ + -DPNG_TESTS=OFF \ + -DPNG_DEBUG=OFF + +ifneq ($(findstring apple-darwin, $(HOST)), apple-darwin) + CMAKE_OPTIONS+= -DPNG_HARDWARE_OPTIMIZATIONS=ON \ + -DPNG_BUILD_ZLIB=ON \ + -DZLIB_LIBRARY=$(PREFIX)/lib/libz.a \ + -DZLIB_INCLUDE_DIR=$(PREFIX)/include +else + ifeq ($(OS), osx) + CMAKE_OPTIONS+= -DPNG_HARDWARE_OPTIMIZATIONS=ON + else + CMAKE_OPTIONS+= -DPNG_HARDWARE_OPTIMIZATIONS=OFF + endif +endif + +LIBDYLIB=$(PLATFORM)/build/$(BYPRODUCT) all: .installed-$(PLATFORM) - $(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE).$(HASH_TYPE) $(DEPS) - rm -rf $(PLATFORM)/*; mkdir -p $(PLATFORM) + rm -rf $(PLATFORM); mkdir -p $(PLATFORM)/build cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE) - cd $(PLATFORM); $(CONFIGURE) - -$(LIBDYLIB): $(PLATFORM) - $(MAKE) -C $(PLATFORM) + cd $(PLATFORM)/build; $(CMAKE) $(CMAKE_OPTIONS) .. -.installed-$(PLATFORM): $(LIBDYLIB) - $(MAKE) -C $(PLATFORM) install +.installed-$(PLATFORM): $(PLATFORM) + $(MAKE) -C $(PLATFORM)/build install touch $@ clean: - $(MAKE) -C $(PLATFORM) clean + $(MAKE) -C $(PLATFORM)/build clean rm -f .installed-$(PLATFORM) distclean:: |