rive-app / rive-app/rive-runtime
Impossible to compile rive using amalgamated (also called unity) builds
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 1.2k
- Forks
- 121
- PR merge metrics
- No merged PRs in 30d
Description
I'm delivering the Rive runtime as a single .h + .cpp file to speed up compilation using cmake UNITY_BUILD but i'm encountering several issues:
- The library has the bad practice of
using namespace rivein cpp files before declaring rive classes implementation. Consider always wrapping Rive code aroundnamespace rive { ... }or it ends up with ambiguous symbols. - There is a missing pragma once in "rive/core/reader.h" and it being included in multiple translation units (that end up being the same in a unity build)
- There are duplicated symbols, like
rive::lerpthat could be isolated in a math utils file.
It would be great if you could allow making the library usable with amalgamated builds.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the failure with CMake UNITY_BUILD and inspect the amalgamated translation unit. Review the C++ files that use using namespace rive, rive/core/reader.h, and the definitions of duplicated symbols such as rive::lerp. Done means the runtime compiles successfully as an amalgamated build without ambiguous or duplicate symbols.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100