From 137e69240618fc81f24ae9e3c47b89e8b571b097 Mon Sep 17 00:00:00 2001 From: Joey Parrish Date: Tue, 18 Jul 2023 01:30:41 -0700 Subject: [PATCH] fix: Fix libpng include directories (#1245) --- packager/third_party/libpng/CMakeLists.txt | 24 +++++++++++++++++++++- packager/third_party/zlib/CMakeLists.txt | 7 +++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/packager/third_party/libpng/CMakeLists.txt b/packager/third_party/libpng/CMakeLists.txt index 9dbc5f29c1..dd0f3ac082 100644 --- a/packager/third_party/libpng/CMakeLists.txt +++ b/packager/third_party/libpng/CMakeLists.txt @@ -22,9 +22,31 @@ set(SKIP_INSTALL_ALL ON) # A confusing name, but this means "let us tell you where to find zlib". set(PNG_BUILD_ZLIB ON) # Tell libpng where to find zlib headers. -set(ZLIB_INCLUDE_DIR ../zlib/source/) +set(ZLIB_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../zlib/source/") # Tell libpng where to find zlib library to link to. set(ZLIB_LIBRARY zlibstatic) +# Silence these warnings: +if(MSVC) + add_compile_options( + /wd4244 + ) +else() + add_compile_options( + -Wno-maybe-uninitialized + -Wno-unused-but-set-variable + -Wno-unused-parameter + -Wno-sign-compare + -Wno-null-pointer-subtraction + ) +endif() + # With these set in scope of this folder, load the library's own CMakeLists.txt. add_subdirectory(source) + +# Add missing include directories for users of png_static: +target_include_directories(png_static PUBLIC + # For png.h, pngconf.h: + source + # For pnglibconf.h: + ${CMAKE_CURRENT_BINARY_DIR}/source) diff --git a/packager/third_party/zlib/CMakeLists.txt b/packager/third_party/zlib/CMakeLists.txt index 60859d6246..0e227b30b7 100644 --- a/packager/third_party/zlib/CMakeLists.txt +++ b/packager/third_party/zlib/CMakeLists.txt @@ -17,5 +17,12 @@ set(SKIP_INSTALL_ALL ON) # work, as the assembly files aren't in the repo for some reason. So don't set # the AMD64 flag. +# Silence these warnings: +if(MSVC) + add_compile_options(/wd4244) +else() + add_compile_options(-Wno-implicit-function-declaration) +endif() + # With these set in scope of this folder, load the library's own CMakeLists.txt. add_subdirectory(source)