Added support for xcode builds Diffs= c12b0bb24 Added support for xcode builds (#7774) Co-authored-by: rivessamr <suki@rive.app>
diff --git a/.rive_head b/.rive_head index eb57b2c..b7f1515 100644 --- a/.rive_head +++ b/.rive_head
@@ -1 +1 @@ -0dc0b435ffb0df61de0afcdc2cea0c69bb8fedd4 +c12b0bb24d1abff5b8df6f9b3a4053fbc5096668
diff --git a/dependencies/premake5_libpng_v2.lua b/dependencies/premake5_libpng_v2.lua index ea26a9e..75e0c8c 100644 --- a/dependencies/premake5_libpng_v2.lua +++ b/dependencies/premake5_libpng_v2.lua
@@ -12,7 +12,7 @@ kind('StaticLib') os.copyfile(libpng .. '/scripts/pnglibconf.h.prebuilt', libpng .. '/pnglibconf.h') includedirs({ libpng, zlib }) - optimize("Speed") -- Always optimize image encoding/decoding, even in debug builds. + optimize('Speed') -- Always optimize image encoding/decoding, even in debug builds. files({ libpng .. '/png.c', libpng .. '/pngerror.c', @@ -45,7 +45,7 @@ kind('StaticLib') defines({ 'ZLIB_IMPLEMENTATION' }) includedirs({ zlib }) - optimize("Speed") -- Always optimize image encoding/decoding, even in debug builds. + optimize('Speed') -- Always optimize image encoding/decoding, even in debug builds. files({ zlib .. '/adler32.c', zlib .. '/compress.c', @@ -70,6 +70,7 @@ buildoptions({ '-Wno-unknown-warning-option', '-Wno-deprecated-non-prototype', + '-Wno-shorten-64-to-32', }) end
diff --git a/dependencies/premake5_sheenbidi_v2.lua b/dependencies/premake5_sheenbidi_v2.lua index 891c963..147f983 100644 --- a/dependencies/premake5_sheenbidi_v2.lua +++ b/dependencies/premake5_sheenbidi_v2.lua
@@ -2,6 +2,7 @@ local dependency = require('dependency') sheenbidi = dependency.github('Tehreer/SheenBidi', 'v2.6') +Headers = sheenbidi .. '/Headers' project('rive_sheenbidi') do @@ -9,7 +10,15 @@ language('C') warnings('Off') - includedirs({ sheenbidi .. '/Headers' }) + includedirs({ Headers }) + + filter('action:xcode4') + do + -- xcode doesnt like angle brackets except for -isystem + -- should use externalincludedirs but GitHub runners dont have latest premake5 binaries + buildoptions({ '-isystem' .. Headers }) + end + filter({}) buildoptions({ '-Wall', '-ansi', '-pedantic' })
diff --git a/dependencies/premake5_yoga_v2.lua b/dependencies/premake5_yoga_v2.lua index 30d8284..68de64a 100644 --- a/dependencies/premake5_yoga_v2.lua +++ b/dependencies/premake5_yoga_v2.lua
@@ -17,6 +17,14 @@ includedirs({ yoga }) + filter('action:xcode4') + do + -- xcode doesnt like angle brackets except for -isystem + -- should use externalincludedirs but GitHub runners dont have latest premake5 binaries + buildoptions({ '-isystem' .. yoga }) + end + filter({}) + files({ yoga .. '/yoga/Utils.cpp', yoga .. '/yoga/YGConfig.cpp',
diff --git a/include/rive/animation/animation_reset.hpp b/include/rive/animation/animation_reset.hpp index b501a83..2828da3 100644 --- a/include/rive/animation/animation_reset.hpp +++ b/include/rive/animation/animation_reset.hpp
@@ -3,7 +3,7 @@ #include <string> #include "rive/artboard.hpp" -#include <rive/animation/animation_reset.hpp> +#include "rive/animation/animation_reset.hpp" #include "rive/core/binary_writer.hpp" #include "rive/core/vector_binary_writer.hpp" #include "rive/core/binary_data_reader.hpp" @@ -29,4 +29,4 @@ void clear(); }; } // namespace rive -#endif \ No newline at end of file +#endif
diff --git a/include/rive/math/math_types.hpp b/include/rive/math/math_types.hpp index 17dfaea..b706afd 100644 --- a/include/rive/math/math_types.hpp +++ b/include/rive/math/math_types.hpp
@@ -61,6 +61,14 @@ return dst; } +// Lossless cast function that asserts on overflow +template <typename T, typename U> T lossless_numeric_cast(U u) +{ + T t = static_cast<T>(u); + assert(static_cast<U>(t) == u); + return t; +} + // Attempt to generate a "clz" assembly instruction. RIVE_ALWAYS_INLINE static int clz32(uint32_t x) {
diff --git a/premake5_v2.lua b/premake5_v2.lua index 5abc30e..35acb87 100644 --- a/premake5_v2.lua +++ b/premake5_v2.lua
@@ -46,6 +46,14 @@ yoga, }) + filter('action:xcode4') + do + -- xcode doesnt like angle brackets except for -isystem + -- should use externalincludedirs but GitHub runners dont have latest premake5 binaries + buildoptions({ '-isystem' .. yoga }) + end + filter({}) + defines({ 'YOGA_EXPORT=' }) files({ 'src/**.cpp' })