Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • L libinput
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 141
    • Issues 141
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 13
    • Merge requests 13
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • libinput
  • libinput
  • Merge requests
  • !224

WIP: fix unity builds

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open hanetzer requested to merge hanetzer/libinput:meson-unity into main May 15, 2019
  • Overview 13
  • Commits 12
  • Pipelines 2
  • Changes 15

Unity builds are an option given by the meson build system, which concatinates source files together using an intermediate source file and #include directives, and then compiles the intermediate source file.

It generally increases compilation speed (especially for lower-threaded machines) overall and can function as a sort of poor man's lto, as multiple translation units are now presented to the compiler as one, increasing the opportunities for inlining and other forms of optimization.

Due to the source files being joined in this manner, the project overall has to be a bit more careful about redefinitions of function and variable names. I've prefixed/suffixed functions with the same name in manners similar to existing changes, and when possible moved shared variables into headers. Further, as the tests make use of interesting preprocessor macros, I've marked them all as being unable to be unity built, so you can still build the overall project with unity and run tests.

This is my best effort at it. If there are changes which you think could be handled better, do let me know. Attached is a log demonstrating the failures when using unity builds. fail.log

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: meson-unity