From 0364d4f91165c354a52eaac461109bbc4efb69a8 Mon Sep 17 00:00:00 2001 From: Peter van Hardenberg Date: Mon, 11 Nov 2024 22:24:33 -0800 Subject: [PATCH 1/4] Update godot to 4.2.2 to fix vulkan support, and add macos as a build platform. --- .gitignore | 1 + CMakeLists.txt | 2 ++ godot | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 1553f7c..b6f9cc2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +*.o *.obj CMakePresets.json build/ diff --git a/CMakeLists.txt b/CMakeLists.txt index 568b6c6..7d199cc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,8 @@ message(STATUS "SCons: ${SCONS_PROGRAM}") if(WIN32) set(GODOT_PLATFORM "windows") +elseif(APPLE) + set(GODOT_PLATFORM "macos") else() set(GODOT_PLATFORM "linuxbsd") endif() diff --git a/godot b/godot index b09f793..15073af 160000 --- a/godot +++ b/godot @@ -1 +1 @@ -Subproject commit b09f793f564a6c95dc76acc654b390e68441bd01 +Subproject commit 15073afe3856abd2aa1622492fe50026c7d63dc1 From c93cb18892938d9c243946dcf62851910b78bc48 Mon Sep 17 00:00:00 2001 From: Peter van Hardenberg Date: Mon, 11 Nov 2024 22:29:54 -0800 Subject: [PATCH 2/4] An attempt to update the README for MacOS. --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index f5cf389..cab77b7 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,11 @@ * Python >= 3.6 * SCons >= 4.5.2 + +On MacOS, you will also need two other things + * MoltenVK (follow [Godot instructions](https://docs.godotengine.org/en/stable/contributing/development/compiling/compiling_for_macos.html) + * llvm-ar (I used homebrew's llvm). + #### Test Prerequisites * Catch2 >= 2.13.8 @@ -50,6 +55,12 @@ cmake -E make_directory build cmake -B build -S . ``` +On MacOS, you need to direct CMake to use your llvm-ar, perhaps like this: + +``` +cmake -DCMAKE_AR=/opt/homebrew/opt/llvm/bin/llvm-ar -B build -S . +``` + 5. Build the project's extended version of Godot >= 4.2 e.g. ``` @@ -64,6 +75,8 @@ Launch the project's extended version of Godot >= 4.2 e.g. godot\bin\godot.windows.editor.x86_64.exe ``` +(On other platforms, the binary name will be slightly different.) + ## Roadmap ## License From cd32ed76218d03e468db8161d12f2c02f74cc994 Mon Sep 17 00:00:00 2001 From: Peter van Hardenberg Date: Mon, 11 Nov 2024 22:33:45 -0800 Subject: [PATCH 3/4] An ugly hack to fix a pointer casting bug. --- .../reality_merge/thirdparty/cavi_usdj-am/src/utils/item.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/reality_merge/thirdparty/cavi_usdj-am/src/utils/item.cpp b/modules/reality_merge/thirdparty/cavi_usdj-am/src/utils/item.cpp index c1c0ff7..d7b0c93 100644 --- a/modules/reality_merge/thirdparty/cavi_usdj-am/src/utils/item.cpp +++ b/modules/reality_merge/thirdparty/cavi_usdj-am/src/utils/item.cpp @@ -147,7 +147,7 @@ Item operator/(Item const& lhs, std::uint64_t const pos) { std::ostream& operator<<(std::ostream& os, Item const& in) { AMbyteSpan key; - std::uint64_t pos; + size_t pos; // The root of a document is a map object. AMvalType val_type = AM_VAL_TYPE_OBJ_TYPE; auto const fmtflags = os.flags(); @@ -158,7 +158,7 @@ std::ostream& operator<<(std::ostream& os, Item const& in) { AMitem const* const c_item = AMresultItem(result.get()); if (AMitemKey(c_item, &key)) { os << "\"" << from_bytes(key) << "\""; - } else if (AMitemPos(c_item, &pos)) { + } else if (AMitemPos(c_item, reinterpret_cast(&pos))) { os << pos; } val_type = AMitemValType(c_item); From 872de49101c09337e8955ee33d06f639e851430c Mon Sep 17 00:00:00 2001 From: Peter van Hardenberg Date: Mon, 11 Nov 2024 22:34:50 -0800 Subject: [PATCH 4/4] Whack-a-mole with some compiler warnings. This might be a very bad idea, but I'm not qualified to tell. There are probably a few more I missed as well but it built with these so here you go. --- .../cavi_usdj-am/include/cavi/usdj_am/class_declaration.hpp | 2 +- .../cavi_usdj-am/include/cavi/usdj_am/class_definition.hpp | 2 +- .../cavi_usdj-am/include/cavi/usdj_am/declaration.hpp | 2 +- .../cavi_usdj-am/include/cavi/usdj_am/definition.hpp | 2 +- .../include/cavi/usdj_am/definition_statement.hpp | 4 ++-- .../cavi_usdj-am/include/cavi/usdj_am/external_reference.hpp | 2 +- .../thirdparty/cavi_usdj-am/include/cavi/usdj_am/file.hpp | 2 +- .../thirdparty/cavi_usdj-am/include/cavi/usdj_am/node.hpp | 2 +- .../thirdparty/cavi_usdj-am/include/cavi/usdj_am/number.hpp | 2 +- .../cavi_usdj-am/include/cavi/usdj_am/object_declaration.hpp | 4 ++-- .../include/cavi/usdj_am/object_declaration_entries.hpp | 2 +- .../include/cavi/usdj_am/object_declaration_list.hpp | 4 ++-- .../include/cavi/usdj_am/object_declaration_list_value.hpp | 4 ++-- .../cavi_usdj-am/include/cavi/usdj_am/object_declarations.hpp | 4 ++-- .../cavi_usdj-am/include/cavi/usdj_am/object_value.hpp | 2 +- .../cavi_usdj-am/include/cavi/usdj_am/reference_file.hpp | 2 +- .../cavi_usdj-am/include/cavi/usdj_am/statement.hpp | 4 ++-- .../cavi_usdj-am/include/cavi/usdj_am/utils/document.hpp | 2 +- .../cavi_usdj-am/include/cavi/usdj_am/utils/item.hpp | 4 ++-- .../cavi_usdj-am/include/cavi/usdj_am/utils/json_writer.hpp | 4 ++-- .../thirdparty/cavi_usdj-am/include/cavi/usdj_am/value.hpp | 4 ++-- .../cavi_usdj-am/include/cavi/usdj_am/variant_definition.hpp | 2 +- .../cavi_usdj-am/include/cavi/usdj_am/variant_set.hpp | 2 +- .../thirdparty/cavi_usdj-am/include/cavi/usdj_am/visitor.hpp | 2 +- modules/reality_merge/usdj_body_updater.h | 4 ++-- modules/reality_merge/usdj_box_size_extractor.h | 2 +- modules/reality_merge/usdj_color_extractor.h | 2 +- modules/reality_merge/usdj_geometry_extractor.h | 2 +- modules/reality_merge/usdj_static_body_3d.h | 2 +- modules/reality_merge/usdj_transform_3d_extractor.h | 2 +- modules/reality_merge/usdj_velocity_extractor.h | 2 +- 31 files changed, 41 insertions(+), 41 deletions(-) diff --git a/modules/reality_merge/thirdparty/cavi_usdj-am/include/cavi/usdj_am/class_declaration.hpp b/modules/reality_merge/thirdparty/cavi_usdj-am/include/cavi/usdj_am/class_declaration.hpp index 9fe6434..d9bbdf8 100644 --- a/modules/reality_merge/thirdparty/cavi_usdj-am/include/cavi/usdj_am/class_declaration.hpp +++ b/modules/reality_merge/thirdparty/cavi_usdj-am/include/cavi/usdj_am/class_declaration.hpp @@ -70,7 +70,7 @@ struct ClassDeclaration : public std::variant operator()(); diff --git a/modules/reality_merge/usdj_color_extractor.h b/modules/reality_merge/usdj_color_extractor.h index c618bfb..dc6aae6 100644 --- a/modules/reality_merge/usdj_color_extractor.h +++ b/modules/reality_merge/usdj_color_extractor.h @@ -55,7 +55,7 @@ class UsdjColorExtractor : public cavi::usdj_am::Visitor { UsdjColorExtractor& operator=(UsdjColorExtractor const&) = delete; - UsdjColorExtractor& operator=(UsdjColorExtractor&&) = default; + UsdjColorExtractor& operator=(UsdjColorExtractor&&) = delete; std::optional operator()(); diff --git a/modules/reality_merge/usdj_geometry_extractor.h b/modules/reality_merge/usdj_geometry_extractor.h index 7869dbd..da2e261 100644 --- a/modules/reality_merge/usdj_geometry_extractor.h +++ b/modules/reality_merge/usdj_geometry_extractor.h @@ -65,7 +65,7 @@ class UsdjGeometryExtractor : public cavi::usdj_am::Visitor { UsdjGeometryExtractor& operator=(UsdjGeometryExtractor const&) = delete; - UsdjGeometryExtractor& operator=(UsdjGeometryExtractor&&) = default; + UsdjGeometryExtractor& operator=(UsdjGeometryExtractor&&) = delete; std::pair operator()(); diff --git a/modules/reality_merge/usdj_static_body_3d.h b/modules/reality_merge/usdj_static_body_3d.h index ef83321..694cf10 100644 --- a/modules/reality_merge/usdj_static_body_3d.h +++ b/modules/reality_merge/usdj_static_body_3d.h @@ -74,7 +74,7 @@ class UsdjStaticBody3D : public PhysicsBody3D { UsdjStaticBody3D(UsdjStaticBody3D&&) = default; - UsdjStaticBody3D& operator=(UsdjStaticBody3D&&) = default; + UsdjStaticBody3D& operator=(UsdjStaticBody3D&&) = delete; AMobjId const* get_object_id() const; diff --git a/modules/reality_merge/usdj_transform_3d_extractor.h b/modules/reality_merge/usdj_transform_3d_extractor.h index a684a18..3ddcd5f 100644 --- a/modules/reality_merge/usdj_transform_3d_extractor.h +++ b/modules/reality_merge/usdj_transform_3d_extractor.h @@ -54,7 +54,7 @@ class UsdjTransform3dExtractor : public cavi::usdj_am::Visitor { UsdjTransform3dExtractor& operator=(UsdjTransform3dExtractor const&) = delete; - UsdjTransform3dExtractor& operator=(UsdjTransform3dExtractor&&) = default; + UsdjTransform3dExtractor& operator=(UsdjTransform3dExtractor&&) = delete; std::optional operator()(); diff --git a/modules/reality_merge/usdj_velocity_extractor.h b/modules/reality_merge/usdj_velocity_extractor.h index ac7a53c..26ebffd 100644 --- a/modules/reality_merge/usdj_velocity_extractor.h +++ b/modules/reality_merge/usdj_velocity_extractor.h @@ -54,7 +54,7 @@ class UsdjVelocityExtractor : public cavi::usdj_am::Visitor { UsdjVelocityExtractor& operator=(UsdjVelocityExtractor const&) = delete; - UsdjVelocityExtractor& operator=(UsdjVelocityExtractor&&) = default; + UsdjVelocityExtractor& operator=(UsdjVelocityExtractor&&) = delete; /// \throws std::invalid_argument std::optional operator()(cavi::usdj_am::usd::physics::TokenType const reference);