Skip to content

Commit

Permalink
Added support for xcode builds
Browse files Browse the repository at this point in the history
Diffs=
c12b0bb24 Added support for xcode builds (#7774)

Co-authored-by: rivessamr <[email protected]>
  • Loading branch information
rivessamr and rivessamr committed Aug 8, 2024
1 parent 9039350 commit a0283f9
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .rive_head
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0dc0b435ffb0df61de0afcdc2cea0c69bb8fedd4
c12b0bb24d1abff5b8df6f9b3a4053fbc5096668
5 changes: 3 additions & 2 deletions dependencies/premake5_libpng_v2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ do
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',
Expand Down Expand Up @@ -45,7 +45,7 @@ do
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',
Expand All @@ -70,6 +70,7 @@ do
buildoptions({
'-Wno-unknown-warning-option',
'-Wno-deprecated-non-prototype',
'-Wno-shorten-64-to-32',
})
end

Expand Down
11 changes: 10 additions & 1 deletion dependencies/premake5_sheenbidi_v2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,23 @@ dofile('rive_build_config.lua')

local dependency = require('dependency')
sheenbidi = dependency.github('Tehreer/SheenBidi', 'v2.6')
Headers = sheenbidi .. '/Headers'

project('rive_sheenbidi')
do
kind('StaticLib')
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' })

Expand Down
8 changes: 8 additions & 0 deletions dependencies/premake5_yoga_v2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ do

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',
Expand Down
4 changes: 2 additions & 2 deletions include/rive/animation/animation_reset.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -29,4 +29,4 @@ class AnimationReset
void clear();
};
} // namespace rive
#endif
#endif
8 changes: 8 additions & 0 deletions include/rive/math/math_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ template <typename Dst, typename Src> Dst bit_cast(const Src& src)
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)
{
Expand Down
8 changes: 8 additions & 0 deletions premake5_v2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ do
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' })
Expand Down

0 comments on commit a0283f9

Please sign in to comment.