sapling/CMake/eden-config.h.in
Adam Simpkins c07261c5ca update build configuration information for Python and C++
Summary:
This updates the top-level CMakeLists.txt file to compute package version
information, and expose this to C++ code in `eden-config.h`, and to Python
code in a new `eden/config.py` module.

Previously we exposed an `EDEN_VERSION` macro for the C++ code in
`eden-config.h`, but this was not initialized or used anywhere.  Now the
top-level CMakeLists.txt file computes appropriate version information and
exposes the package name, version, release, commit ID, and build time in these
configuration files.

The version selection logic in CMakeLists.txt based largely on the code that
wez wrote for watchman in D20636833.

Reviewed By: wez

Differential Revision: D21000164

fbshipit-source-id: db1a1035f1eefec058bbad558d35e113005e454e
2020-04-22 12:48:47 -07:00

41 lines
1.3 KiB
C

/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This software may be used and distributed according to the terms of the
* GNU General Public License version 2.
*/
#pragma once
#include <cstdint>
/*
* We put the build version and timestamp in a .cpp file to avoid changing
* this header any time CMake is re-run. We don't want to have to re-compile
* files that include this header simply because the build timestamp changed.
*/
extern "C" {
extern const char* const Eden_BuildInfo_kPackageName;
extern const char* const Eden_BuildInfo_kPackageVersion;
extern const char* const Eden_BuildInfo_kPackageRelease;
extern const char* const Eden_BuildInfo_kRevision;
extern const uint64_t Eden_BuildInfo_kTimeUnix;
}
#define EDEN_PACKAGE_NAME (::Eden_BuildInfo_kPackageName)
#define EDEN_VERSION (::Eden_BuildInfo_kPackageVersion)
#define EDEN_RELEASE (::Eden_BuildInfo_kPackageRelease)
#define EDEN_BUILD_REVISION (::Eden_BuildInfo_kRevision)
#define EDEN_BUILD_TIME_UNIX (::Eden_BuildInfo_kTimeUnix)
#define EDEN_BUILD_FLAVOR "CMake"
#define EDEN_ETC_EDEN_DIR "${ETC_EDEN_DIR}"
#cmakedefine EDEN_HAVE_CURL
#cmakedefine EDEN_HAVE_GIT
#cmakedefine EDEN_HAVE_ROCKSDB
#cmakedefine EDEN_HAVE_SELINUX
#cmakedefine EDEN_HAVE_SQLITE3
#cmakedefine EDEN_HAVE_SYSTEMD
#cmakedefine EDEN_HAVE_MONONOKE
#define EDEN_HAVE_RUST_DATAPACK 1