sapling/CMake/eden-config.py.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

23 lines
625 B
Python

#!/usr/bin/env python3
#
# Copyright (c) 2020-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
#
"""
This file provides access to build-time configuration data for EdenFS.
"""
PACKAGE_NAME = "@PROJECT_NAME@"
VERSION = "@EDEN_VERSION@"
RELEASE = "@EDEN_RELEASE@"
BUILD_REVISION = "@EDEN_BUILD_REVISION@"
BUILD_TIME_UNIX = @EDEN_BUILD_TIME_UNIX@
BUILD_FLAVOR = "CMake"
HAVE_GIT = @EDEN_HAVE_GIT_PY@