-
Notifications
You must be signed in to change notification settings - Fork 6
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
Standalone krnlmon build #56
Conversation
Signed-off-by: Derek G Foster <[email protected]>
An even cooler way to do standalone builds: es2k-config.cmakeset(DEPEND_INSTALL_DIR "/opt/deps" CACHE PATH
"config: Dependencies install directory")
set(SDE_INSTALL_DIR "/opt/p4sde/mev" CACHE PATH
"config: SDE install directory")
get_filename_component(_path "${CMAKE_SOURCE_DIR}/../SAI" REALPATH)
set(SAI_SOURCE_DIR "${_path}" CACHE PATH "config: SAI source directory")
# P4 Control Plane cmake modules
get_filename_component(_path "${CMAKE_SOURCE_DIR}/../../cmake" REALPATH)
set(CMAKE_MODULE_PATH "${_path}" CACHE PATH "" FORCE)
set(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/install" CACHE PATH "")
set(TDI_TARGET "es2k" CACHE STRING "config: TDI target type")
unset(_path) Usagecmake -B build -C es2k-config.cmake
cmake --build build -j4 |
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.
One question on the PROJECT VERSION. Rest LGTM
@@ -7,16 +7,28 @@ | |||
# Version 3.15 is the baseline for P4 Control Plane. | |||
cmake_minimum_required(VERSION 3.15) | |||
|
|||
project(krnlmon LANGUAGES C CXX) | |||
project(krnlmon VERSION 2.0 LANGUAGES C CXX) |
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.
Are we (planning to) giving each submodule a version number?
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.
I'm leaning in favor of versioning cmake projects that are, or may be considered to be, discrete packages or components.
krnlmon already had a version number of sorts, defined by the VERSION
variable later in this file and substituted into the libkrnlmon
pkg-config file.
This CL moves the definition to the cmake project()
command, bumps the version number from 1.0 to 2.0, and replaces the VERSION
variable with PROJECT_VERSION
when creating the pkg-config file.
CMake defines PROJECT_VERSION
when you specify project(VERSION x.x)
.
- Set the recommended compiler options in standalone mode. - Update internal documentation. Signed-off-by: Derek G Foster <[email protected]>
This CL makes it possible to build the Kernel Monitor from its own cmake listfile, independently (more or less) of P4 Control Plane.
For example:
The chief awkwardness is making the
SelectTdiTarget
,FindDpdkDriver
, andFindTofinoDriver
modules available to the standalone build. The long-term solution is probably to create a separate repository that contains the common modules and reference it through a cmake variable in any project that requires them.Reasons for supporting standalone build:
The effort has led to additional error checks and some improvements in the krnlmon build.