From 7f92fea3dc3e24ec55c74d4d398e59a37b5ccb5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Thu, 25 Apr 2024 19:18:46 -0300 Subject: [PATCH] Try fix CI. --- premake4.lua | 16 +++++++++++----- premake5.lua | 21 +++++++++++++++++---- projects/macos/make_no_fw.sh | 2 +- 3 files changed, 29 insertions(+), 10 deletions(-) diff --git a/premake4.lua b/premake4.lua index 2cab9ac11..76aa095e4 100644 --- a/premake4.lua +++ b/premake4.lua @@ -364,7 +364,7 @@ function build_base_configuration( package_name ) end set_ios_config() - set_xcode_config() + set_apple_config() build_arch_configuration() configuration "debug" @@ -409,7 +409,7 @@ function build_base_cpp_configuration( package_name ) end set_ios_config() - set_xcode_config() + set_apple_config() build_arch_configuration() if _OPTIONS["with-static-eepp"] then @@ -585,7 +585,7 @@ function build_link_configuration( package_name, use_ee_icon ) end set_ios_config() - set_xcode_config() + set_apple_config() build_arch_configuration() configuration "debug" @@ -786,12 +786,18 @@ function add_sdl2() end end -function set_xcode_config() +function set_apple_config() if is_xcode() or _OPTIONS["use-frameworks"] then linkoptions { "-F /Library/Frameworks" } buildoptions { "-F /Library/Frameworks" } includedirs { "/Library/Frameworks/SDL2.framework/Headers" } + end + if os.is("macosx") then defines { "EE_SDL2_FROM_ROOTPATH" } + if not is_xcode() and not _OPTIONS["use-frameworks"] then + local sdl2flags = popen("sdl2-config --cflags"):gsub("\n", "") + buildoptions { sdl2flags } + end end end @@ -935,7 +941,7 @@ function build_eepp( build_name ) set_macos_and_ios_config() set_ios_config() - set_xcode_config() + set_apple_config() add_static_links() diff --git a/premake5.lua b/premake5.lua index 6a0de869d..5c05cadf4 100644 --- a/premake5.lua +++ b/premake5.lua @@ -147,6 +147,13 @@ function incdirs( dirs ) includedirs { dirs } end +function popen( executable_path ) + local handle = io.popen(executable_path) + local result = handle:read("*a") + handle:close() + return result +end + function download_and_extract_sdl(sdl_url) print("Downloading: " .. sdl_url) local dest_dir = "src/thirdparty/" @@ -212,7 +219,7 @@ function build_base_configuration( package_name ) incdirs { "src/thirdparty/zlib" } set_ios_config() - set_xcode_config() + set_apple_config() build_arch_configuration() filter "not system:windows" @@ -245,7 +252,7 @@ function build_base_cpp_configuration( package_name ) end set_ios_config() - set_xcode_config() + set_apple_config() build_arch_configuration() if _OPTIONS["with-static-eepp"] then @@ -315,7 +322,7 @@ function build_link_configuration( package_name, use_ee_icon ) cppdialect "C++17" set_ios_config() - set_xcode_config() + set_apple_config() build_arch_configuration() filter { "system:linux or system:macosx or system:haiku or system:bsd", "action:not vs*" } @@ -533,12 +540,18 @@ function add_sdl2() table.insert( backends, "SDL2" ) end -function set_xcode_config() +function set_apple_config() if is_xcode() or _OPTIONS["use-frameworks"] then linkoptions { "-F /Library/Frameworks" } buildoptions { "-F /Library/Frameworks" } incdirs { "/Library/Frameworks/SDL2.framework/Headers" } + end + if os.istarget("macosx") then defines { "EE_SDL2_FROM_ROOTPATH" } + if not is_xcode() and not _OPTIONS["use-frameworks"] then + local sdl2flags = popen("sdl2-config --cflags"):gsub("\n", "") + buildoptions { sdl2flags } + end end end diff --git a/projects/macos/make_no_fw.sh b/projects/macos/make_no_fw.sh index 35ae0a927..91f408041 100755 --- a/projects/macos/make_no_fw.sh +++ b/projects/macos/make_no_fw.sh @@ -5,7 +5,7 @@ premake4 --file=../../premake4.lua --disable-static-build gmake cd ../../make/macosx/ sed -e "s/-Wl,-x//g" -i .make -make -j$(sysctl -n hw.ncpu) $@ +make -j$(sysctl -n hw.ncpu) -e verbose=true $@ cd ../../bin/ ln -sf ../libs/macosx/libeepp.dylib .