Changeset 24998

Timestamp:
Mar 3, 2021, 5:11:41 PM (3 years ago)
Author:
s0600204
Message:

Use pkgconfig to find libpng

Should hopefully resolve an issue raised on IRC by @spcman and @Xavi92

Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D3610

Location:
ps/trunk/build
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ps/trunk/build/premake/extern_libs5.lua

    r24704 r24998  
    412412    libpng = {
    413413        compile_settings = function()
    414             if os.istarget("windows") or os.istarget("macosx") then
     414            if os.istarget("windows") then
    415415                add_default_include_paths("libpng")
    416             end
    417             if os.getversion().description == "OpenBSD" then
    418                 sysincludedirs { "/usr/local/include/libpng" }
    419             end
    420         end,
    421         link_settings = function()
    422             if os.istarget("windows") or os.istarget("macosx") then
     416            else
     417                -- Support LIBPNG_CONFIG for overriding the default (pkg-config --cflags libpng)
     418                -- i.e. on OSX where it gets set in update-workspaces.sh
     419                pkgconfig.add_includes("libpng", os.getenv("LIBPNG_CONFIG"))
     420            end
     421        end,
     422        link_settings = function()
     423            if os.istarget("windows") then
    423424                add_default_lib_paths("libpng")
    424             end
    425             add_default_links({
    426                 win_names  = { "libpng16" },
    427                 unix_names = { "png" },
    428                 -- Otherwise ld will sometimes pull in ancient 1.2 from the SDK, which breaks the build :/
    429                 -- TODO: Figure out why that happens
    430                 osx_names = { "png16" },
    431             })
     425                add_default_links({
     426                    win_names  = { "libpng16" },
     427                })
     428            else
     429                pkgconfig.add_links("libpng", os.getenv("LIBPNG_CONFIG"), "--ldflags")
     430            end
    432431        end,
    433432    },
  • ps/trunk/build/workspaces/update-workspaces.sh

    r24388 r24998  
    7474  export GLOOX_CONFIG=${GLOOX_CONFIG:="$(pwd)/../../libraries/osx/gloox/bin/gloox-config"}
    7575  export ICU_CONFIG=${ICU_CONFIG:="$(pwd)/../../libraries/osx/icu/bin/icu-config"}
     76
    7677  export SDL2_CONFIG=${SDL2_CONFIG:="$(pwd)/../../libraries/osx/sdl2/bin/sdl2-config"}
    7778  export WX_CONFIG=${WX_CONFIG:="$(pwd)/../../libraries/osx/wxwidgets/bin/wx-config"}
Note: See TracChangeset for help on using the changeset viewer.