Fix build with CMake 3.15
ClosedPublic

Authored by adridg on Aug 10 2019, 7:54 PM.

Details

Summary
  • The build flags for the C part of the library overwrite the compile flags for C++, in particular, they add -std=c99 to the C++ compilation.
  • The C parts get auto-mocced (!) which generates a C++ file (although it's empty), which then gets compiled with the C flags (and weird -std= setting).
  • For clang, that leads to a build failure.

So switch out some things:

  • Build the C parts as an OBJECT library,
  • Don't apply the C flags to anything but that OBJECT library,
  • and don't automoc C code.
Test Plan

It now builds when CMake 3.15.2 is used.

Diff Detail

Repository
R157 Peruse
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
adridg requested review of this revision.Aug 10 2019, 7:54 PM
adridg created this revision.
leinir accepted this revision.Mar 18 2020, 1:22 PM

Oh dear, this seems to have passed me by somehow... please do the thing :)

This revision is now accepted and ready to land.Mar 18 2020, 1:22 PM
This revision was automatically updated to reflect the committed changes.