Skip to content

Commit

Permalink
ryml_all.hpp: fix android, disable exception
Browse files Browse the repository at this point in the history
  • Loading branch information
beicause committed Aug 23, 2024
1 parent f37aaf8 commit da14142
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
8 changes: 5 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
shell_name = "gd-env";
extra_envs = {
IN_NIX_SHELL = "1";
ANDROID_NDK_HOME = "~/Android/ndk/23.2.8568313/";
ANDROID_HOME = "/home/lzh/Android/";
ANDROID_NDK_HOME = extra_envs.ANDROID_HOME + "ndk/23.2.8568313/";
NIX_SHELL_NAME = shell_name;
};
fhs_env =
Expand All @@ -46,15 +47,16 @@
targetPkgs = pkgs: deps;
profile = ''
export IN_NIX_SHELL=${extra_envs.IN_NIX_SHELL};
export ANDROID_HOME="${extra_envs.ANDROID_HOME}";
export ANDROID_NDK_HOME="${extra_envs.ANDROID_NDK_HOME}";
export NIX_SHELL_NAME="${extra_envs.NIX_SHELL_NAME}";
'';
runScript = script;
}
));
# build_dev_script = "scons use_llvm=yes dev_build=yes deprecated=no tests=no platform=linuxbsd target=editor compiledb=yes";
# build_prod_script = "scons use_llvm=yes dev_build=no deprecated=no tests=no platform=linuxbsd target=editor compiledb=yes";
in
# build_dev_script = "scons use_llvm=yes dev_build=yes deprecated=no tests=no platform=linuxbsd target=editor compiledb=yes";
# build_prod_script = "scons use_llvm=yes dev_build=no deprecated=no tests=no platform=linuxbsd target=editor compiledb=yes";
{
devShells."${system}" = {
default = (fhs_env "fish").env;
Expand Down
9 changes: 9 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,12 @@ dev:

prod:
scons use_llvm=yes dev_build=no platform=linuxbsd target=editor compiledb=yes

template_debug_android:
scons use_llvm=yes dev_build=yes platform=android target=template_debug compiledb=yes \
disable_3d="yes" \
deprecated="no" \
module_mobile_vr_enabled="no" \
module_openxr_enabled="no" \
module_webrtc_enabled="no" \
module_webxr_enabled="no" \
2 changes: 1 addition & 1 deletion modules/a_jsonnet/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ Import("env")
Import("env_modules")

env_module = env_modules.Clone()
env_module.Append(CPPFLAGS="-fexceptions")

# Thirdparty source files

Expand Down Expand Up @@ -43,6 +42,7 @@ env_module.Append(

env_thirdparty = env_module.Clone()
env_thirdparty.Append(CPPDEFINES=["_USE_MATH_DEFINES"])
env_thirdparty.Append(CPPFLAGS="-fexceptions")
env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
env.modules_sources += thirdparty_obj
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16792,7 +16792,7 @@ template<typename R, typename... Args> struct vtable

explicit constexpr vtable() noexcept :
invoke_ptr{ [](storage_ptr_t, Args&&...) -> R
{ throw std::bad_function_call(); }
{ /*throw std::bad_function_call();*/ }
},
copy_ptr{ [](storage_ptr_t, storage_ptr_t) noexcept -> void {} },
move_ptr{ [](storage_ptr_t, storage_ptr_t) noexcept -> void {} },
Expand Down Expand Up @@ -17334,7 +17334,7 @@ void* aalloc_impl(size_t size, size_t alignment)
#if defined(C4_WIN) || defined(C4_XBOX)
mem = ::_aligned_malloc(size, alignment);
C4_CHECK(mem != nullptr || size == 0);
#elif defined(C4_ARM)
#elif defined(C4_ARM) || defined(C4_ANDROID)
// https://stackoverflow.com/questions/53614538/undefined-reference-to-posix-memalign-in-arm-gcc
// https://electronics.stackexchange.com/questions/467382/e2-studio-undefined-reference-to-posix-memalign/467753
mem = memalign(alignment, size);
Expand Down

0 comments on commit da14142

Please sign in to comment.