Page MenuHomePhabricator

Add top-level cpp CMake Project
Changes PlannedPublic

Authored by jon on Jun 19 2022, 1:55 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 22, 6:08 AM
Unknown Object (File)
Fri, Nov 22, 5:15 AM
Unknown Object (File)
Thu, Nov 21, 11:24 PM
Unknown Object (File)
Sat, Nov 16, 4:20 AM
Unknown Object (File)
Sun, Oct 27, 6:50 AM
Unknown Object (File)
Oct 23 2024, 8:45 PM
Unknown Object (File)
Oct 22 2024, 4:49 PM
Unknown Object (File)
Oct 13 2024, 11:48 PM

Details

Summary

Expose top-level for all cpp code

This is required since sqlite_orm is required by some CommonCpp projects

This is part of a larger effort to bring more structure to the C++ codebase https://linear.app/comm/issue/ENG-1310/export-nativecpp-projects-as-cmake-projects

The intent is to be able to reference the dependencies as packages, instead of just as GLOB'ing over certain directories; which is a major anti-pattern in CMake as it create a bunch of footguns such as finding multiple files with main() defined, or picking up unrelated code in generated folders.

Test Plan
nix develop
cd native/cpp/ && mkdir build && cd build && cmake .. && make
# should build everything in native/cpp

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.Jun 19 2022, 2:00 PM
Harbormaster failed remote builds in B9815: Diff 13579!

Update with protobuf changes

Harbormaster returned this revision to the author for changes because remote builds failed.Jul 3 2022, 9:21 AM
Harbormaster failed remote builds in B10230: Diff 14117!
Harbormaster failed remote builds in B10232: Diff 14119!
jon edited the summary of this revision. (Show Details)

Lint

Harbormaster returned this revision to the author for changes because remote builds failed.Jul 7 2022, 3:41 PM
Harbormaster failed remote builds in B10392: Diff 14302!
native/cpp/CMakeLists.txt
3 ↗(On Diff #14302)

A bit confused seeing this after the convo in ENG-1356. This CMakeLists.txt only get consumed for the Android build, right? How did we manage to get Android to cooperate with a newer version of CMake?

I think I did this work in anticipation of doing the android build "the right way" with imported targets. I decided later to drop that work.

However, I still like just doing add_subdirectory(../native/cpp) to import this from other areas in the code base.

ashoat requested changes to this revision.Jul 18 2022, 9:48 AM

So should we remove the comment? Still confused about the comment. Also not sure what CMP0079 is

This revision now requires changes to proceed.Jul 18 2022, 9:48 AM
atul requested changes to this revision.Aug 11 2022, 10:30 AM
native/cpp/CMakeLists.txt:12,02: [C0307] Bad indentation:
  )
^----BodyNode: 1:0->StatementNode: 9:0->TreeNode: 12:2
This revision now requires changes to proceed.Aug 11 2022, 10:30 AM
jon edited the test plan for this revision. (Show Details)