-
Notifications
You must be signed in to change notification settings - Fork 346
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
CMake Integration #22
base: master
Are you sure you want to change the base?
Conversation
…". Moved Perf in "perf" directory. Added CMakelist to generate library and decompressor. Added functionality to generate NanoLog.pc to easily integrate with other cmake projects using pkg-config
Hi waqqas,
Sorry for the late reply, I had to find the time to pull the patch and check it out. Some comments/fixes I'd like before I merge the patch are:
Some other notes I have are:
Best Regards, |
file(GLOB SOURCES ${PROJECT_SOURCE_DIR}/runtime/*.cc ${PROJECT_SOURCE_DIR}/runtime/testHelper/GeneratedCode.cc) | ||
add_library(${PROJECT_NAME} ${SOURCES} ${HEADERS}) | ||
|
||
target_include_directories(${PROJECT_NAME} PRIVATE ${PROJECT_SOURCE_DIR}/runtime) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be marked as PUBLIC not PRIVATE to ensure that non standalone builds get the correct include directories.
We should support people consuming the library directly through CMake rather than through PkcConfig. https://cliutils.gitlab.io/modern-cmake/chapters/install.html |
I don't think removing the googletest submodule is the correct way to go. Requiring a manual installation of gtest is just added work and has potential for breaking changes if the user installs a version of gtest that has breaking changes to the one we ran our CI against. The existing solution of using submodules to refer to an exact commit ensures consistency between user experience and our CI builds. |
find_package(RT REQUIRED) | ||
|
||
file(GLOB HEADERS ${PROJECT_SOURCE_DIR}/runtime/*.h) | ||
file(GLOB SOURCES ${PROJECT_SOURCE_DIR}/runtime/*.cc ${PROJECT_SOURCE_DIR}/runtime/testHelper/GeneratedCode.cc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GeneratedCode.cc is not a file that exists in the repo - it has to be generated by the preprocessor script. I don't think this command succeed on a standard check out. @syang0 do you have CI checks enabled on pull requests? I see no checks ran on this PR and I suspect they should be failing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, CI checks are only enabled on the main branch. They wouldn't have run anyway for this PR since it substantially changed the build structure and where the executables exist.
Perhaps ci builds should be enabled for pull requests to master so? Looks
like there's an option in the GitHub settings for that. It would avoid
accidently merging a PR that breaks everyone on matter. This would require
this pr to modify the yaml settings to add CMake builds.
…On Thu, 13 Feb 2020, 6:50 am syang0, ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In CMakeLists.txt
<#22 (comment)>:
> @@ -0,0 +1,50 @@
+cmake_minimum_required(VERSION 3.10)
+
+project(NanoLog VERSION 0.0.1 DESCRIPTION "Nanolog is an extremely performant nanosecond scale logging system for C++ that exposes a simple printf-like API.")
+
+list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/modules")
+
+set(CMAKE_CXX_STANDARD 17)
+
+# pre-requisites
+find_package(Threads REQUIRED)
+find_package(RT REQUIRED)
+
+file(GLOB HEADERS ${PROJECT_SOURCE_DIR}/runtime/*.h)
+file(GLOB SOURCES ${PROJECT_SOURCE_DIR}/runtime/*.cc ${PROJECT_SOURCE_DIR}/runtime/testHelper/GeneratedCode.cc)
No, CI checks are only enabled on the main branch. They wouldn't have run
anyway for this PR since it substantially changed the build structure and
where the executables exist.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#22?email_source=notifications&email_token=AL5LS3E5XI4L4T3ZSPWZ5ODRCSYO7A5CNFSM4KGT6GGKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCVKX7PI#discussion_r378625818>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AL5LS3AZRXYMXHROWJQYSLDRCSYO7ANCNFSM4KGT6GGA>
.
|
Build NanoLog (cpp17) with cmake.
apt-get install googletest
Sample integration with cmake project
TODO: move preprocessor version to cmake