Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added CMakeLists.txt and Makefile for clean & fast builds of external projects that use Current. #956

Merged
merged 25 commits into from
Jan 3, 2024

Conversation

dimacurrentai
Copy link
Contributor

No description provided.

@dimacurrentai
Copy link
Contributor Author

Hi @mzhurovich!

This was easier than I thought!

README.

Clean test:

$ mkdir clean_current_cmake_test
$ cd clean_current_cmake_test
$ wget https://raw.githubusercontent.com/dimacurrentai/Current/cmake/cmake/run-cmake-test.sh
$ chmod +x run-cmake-test.sh
$ ./run-cmake-test.sh

...

One-line change time, Current gtest, debug: 3s
One-line change time, Current gtest, release: 8s

One-line change time, Google gtest, debug: 3s
One-line change time, Google gtest, release: 2s

This test is also run by a Github Action, both on Linux and on macOS.

What this means now is that using Current, with fast incremental builds, and with a non-header-only Googletest, is just a matter of:

  • Putting your code under src/*.cc (as well as src/lib_*.cc and src/test_*.cc),
  • Grabbing the Makefile from C5T/Current/cmake, and
  • Running make, or make {debug/release/debug_test/release_test/fmt/clean}.

Thanks,
Dima (from Windows)

@@ -0,0 +1,68 @@
# TODO(dkorolev): Consider intelligently re-running `cmake` from the `Makefile` if the set of source files has changed.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE(dkorolev), @mzhurovich, this was tested a long time ago in https://github.com/dkorolev/example_use_current_with_cmake, just cleaned up a bit and moved this into current.'

@dimacurrentai
Copy link
Contributor Author

@mzhurovich, added support for dynamic libraries too, and tested on Linux, WSL, and macOS!

@dimacurrentai
Copy link
Contributor Author

Probably best to review per commit, but, to get a feel, cmake/run-cmake-test.sh is self-contained and self-explanatory!

@mzhurovich
Copy link
Member

@dimacurrentai I have one question - why q/q/q? =)

@dimacurrentai
Copy link
Contributor Author

dimacurrentai commented Jan 3, 2024 via email

@mzhurovich mzhurovich merged commit 08292f8 into C5T:stable Jan 3, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants