diff --git a/build/premake/extern_libs5.lua b/build/premake/extern_libs5.lua index 54924e4516..6807dc7e0a 100644 --- a/build/premake/extern_libs5.lua +++ b/build/premake/extern_libs5.lua @@ -80,8 +80,16 @@ local function add_default_links(def) names = def.android_names elseif os.istarget("linux") and def.linux_names then names = def.linux_names - elseif os.istarget("macosx") and def.osx_names then - names = def.osx_names + elseif os.istarget("macosx") and (def.osx_names or def.osx_frameworks) then + if def.osx_names then + names = def.osx_names + end + -- OS X "Frameworks" are added to the links as "name.framework" + if def.osx_frameworks then + for i,name in pairs(def.osx_frameworks) do + links { name .. ".framework" } + end + end elseif os.istarget("bsd") and def.bsd_names then names = def.bsd_names elseif def.unix_names then @@ -100,22 +108,16 @@ local function add_default_links(def) suffix = "" end - -- OS X "Frameworks" are added to the links as "name.framework" - if os.istarget("macosx") and def.osx_frameworks then - for i,name in pairs(def.osx_frameworks) do - links { name .. ".framework" } - end - else - for i,name in pairs(names) do - filter "Debug" - links { name .. suffix } - filter "Release" - links { name } - filter { } + for i,name in pairs(names) do + filter "Debug" + links { name .. suffix } + filter "Release" + links { name } + filter { } - add_delayload(name, suffix, def) - end + add_delayload(name, suffix, def) end + end -- Library definitions @@ -152,18 +154,21 @@ end -- * extern_lib: to be used in the libpath. -- -- add_default_links --- Description: Adds links to libraries and configures delayloading. --- If the *_names parameter for a plattform is missing, no linking will be done --- on that plattform. --- The default assumptions are: --- * debug import library and DLL are distinguished with a "d" suffix --- * the library should be marked for delay-loading. --- Parameters: +-- Description: Adds links to libraries and configures delayloading. +-- If the *_names parameter for a plattform is missing, no linking will be done +-- on that plattform. +-- The default assumptions are: +-- * debug import library and DLL are distinguished with a "d" suffix +-- * the library should be marked for delay-loading. +-- Parameters: -- * win_names: table of import library / DLL names (no extension) when --- running on Windows. +-- running on Windows. -- * unix_names: as above; shared object names when running on non-Windows. --- * osx_names: as above; for OS X specifically (overrides unix_names if both are --- specified) +-- * osx_names, osx_frameworks: for OS X specifically; if any of those is +-- specified, unix_names is ignored. Using both is possible if needed. +-- * osx_names: as above. +-- * osx_frameworks: as above, for system libraries that need to be linked +-- as "name.framework". -- * bsd_names: as above; for BSD specifically (overrides unix_names if both are -- specified) -- * linux_names: ditto for Linux (overrides unix_names if both given) @@ -368,6 +373,8 @@ extern_lib_defs = { add_default_links({ win_names = { "libcurl" }, unix_names = { "curl" }, + osx_names = { "curl", "z" }, + osx_frameworks = { "Security" } }) end, }, diff --git a/build/premake/premake4.lua b/build/premake/premake4.lua index 1073f0d1d0..8b997e22a7 100644 --- a/build/premake/premake4.lua +++ b/build/premake/premake4.lua @@ -722,6 +722,7 @@ function setup_all_libs () "tinygettext", "icu", "iconv", + "libsodium", } if not _OPTIONS["without-audio"] then diff --git a/libraries/osx/build-osx-libs.sh b/libraries/osx/build-osx-libs.sh index 990622c73d..dd98ad5b94 100755 --- a/libraries/osx/build-osx-libs.sh +++ b/libraries/osx/build-osx-libs.sh @@ -361,7 +361,7 @@ then if [[ $MIN_OSX_VERSION && ${MIN_OSX_VERSION-_} ]]; then CONF_OPTS="$CONF_OPTS --with-macosx-version-min=$MIN_OSX_VERSION" fi - (../configure CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" CPPFLAGS="-stdlib=libc++" LDFLAGS="$LDFLAGS" $CONF_OPTS && make ${JOBS} && make install) || die "wxWidgets build failed" + (../configure CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" CPPFLAGS="-stdlib=libc++ -D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES=1" LDFLAGS="$LDFLAGS" $CONF_OPTS && make ${JOBS} && make install) || die "wxWidgets build failed" popd popd touch .already-built