Repository navigation
Conversation
Warnings apply to engine sources only, vendors are added as SYSTEM. ENGINE_API now means default visibility outside Windows, and the classes and free functions that were missing it get it.
…lity # Conflicts: # include/public/Core/Object.hpp
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
Two things on the
Enginetarget, stacked on #194.Warnings: engine sources now build with
-Wall -Wextra -Wpedanticon GCC/Clang and/W4on MSVC. No-Werror. They are set per source on the engine's own.cppfiles, so the imgui sources,glad.candstb_image_impl.cppthat get compiled into the target are left alone. The vendor subdirectories are added withSYSTEMand the vendor include dirs (spdlog, json, imgui, glad, stb, Vulkan) moved to aSYSTEMblock, so warnings from their headers do not show up in engine TUs either.Visibility:
CXX_VISIBILITY_PRESET hidden,C_VISIBILITY_PRESET hiddenandVISIBILITY_INLINES_HIDDENon the target, andENGINE_APIinCore/OSDef.hppis now__attribute__((visibility("default")))everywhere that is not Windows (one define after the platform chain instead of the three empty ones). ThenENGINE_APIon what was missing it:PhysicsWorld,DynamicAABBTree,Timer,File,Quaternion,Color,Serializable,SerializationFactory,Object,RandomPhysics/CollisionDetection.hpp(TestAABBvsAABBand friends,TestCollision,ClosestPointOnSegment,ClosestPointsSegmentSegment) andMath::operator*(const Quaternion&, const Vector3D&)ObjectandRandomare header only but still need it: they havestatic inlinedata members (s_nextUniqueID,generator_). With hidden visibility the engine and the game would each get their own copy of those, which is the kind of bug that does not fail to link, it just quietly hands out duplicate IDs.EventDispatcherhas the same pattern witheventHandlersand was alreadyENGINE_API.Also dropped
ENGINE_APIfrom theclass Window;forward declaration inVulkanRenderer.hpp, GCC warns that attributes on an already defined type are ignored.Why
On Linux every symbol was exported, so a missing
ENGINE_APIonly ever showed up as a link error on Windows. Now Linux behaves like the DLL does, the export table drops from everything (imgui, VMA, glad, all the backend classes) to what is marked, and a forgottenENGINE_APIfails on the platform most of us build on.To find what was missing I did not just rely on SleakCraft linking: I diffed the strong symbols defined in the engine's object files against
nm -Dof the builtlibEngined.so. After this change the onlySleak::symbols left hidden outside the render backends areMessageBox/ShowMessageBox(fromCore/WindowHelper.hpp, only used byApplication.cpp) and the privateRenderCommandQueue/ResourceManager/*Commandclasses frominclude/private. SleakSims, SleakEngine-Empty and SleakEngine-FPP only includeCore/,Math/,Runtime/,Lighting/,Camera/,Events/,UI/andMemory/public headers and none of them touch those hidden names, so they should link the same as before. I did not build them though.The diff in a few headers (
Random.hpp,Quaternion.hpp,File.hpp,Object.hpp,Timer.hpp,CollisionDetection.hpp) is bigger than the one word change, that isgit clang-formatreindenting the class body once theclassline was touched.Warning count, GCC 16 Debug, SleakCraft tree: 769 unique diagnostics from engine code. 723 of those are
-Wswitchfrom three switches overKEY_CODE(Application.cpp:292,FreeLookCameraControllerComponent.cpp:148and:160), one per unhandled enumerator. The other 46: 29-Wunused-parameter(mostlyECS/Component.hppandRuntime/Texture.hppdefault virtuals), 9-Wreorder(Object,GameObject,Component), 4-Wunused-variable, and one each of-Wsign-compare(List.hpp),-Wignored-qualifiers(Queue.hpp),-Wunused-but-set-variable(Matrix.hpp) and-Wdelete-incomplete(RefPtr.hpp:76).-Wpedanticadded zero on GCC, so I kept it. Clang and MSVC counts I have not looked at.Not covered here: fixing those warnings. The
-Wdelete-incompleteone inRefPtris the only one that looks like a real bug (deleting through an incomplete type is UB when the destructor is not trivial) and deserves its own PR.How it was verified
SleakCraft built against this branch (Debug, Ninja), no undefined references. Ran under xvfb with the x11 SDL driver and
-world citest -seed 42 -rd 4: OpenGL on Mesa llvmpipe for 90s (world created) and Vulkan on the RTX 4050 for 60s (world loaded), no errors, both killed by the timeout. Game side logging throughLogger::GetLogger()still shows up in the log. I did not drive any input in the headless runs.Windows:
ENGINE_APIon the new classes means they are nowdllexport/dllimportthere too, which only adds exports, but I could not compile it here. Since this targets the #194 branch the PR checks do not run on it, so I kicked the CI workflow by hand on the branch: Linux Debug/Release/Clang and Windows Debug/Release all build (https://github.com/CanReader/SleakEngine/actions/runs/37221196589). Format, clang-tidy and the downstream game job only run on PRs to main, so those will run once this is retargeted.Checklist
///commentssrc/orinclude/private/in public headers