ceed-config.c (b4e8f36611be7afa0ac740a4e69c9edbf766dc7e) ceed-config.c (3b9caef58af0b75e45cbbaf9089919028a809fac)
1// Copyright (c) 2017-2025, Lawrence Livermore National Security, LLC and other CEED contributors.
2// All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
3//
4// SPDX-License-Identifier: BSD-2-Clause
5//
6// This file is part of CEED: http://github.com/ceed
7
8#include <ceed-impl.h>
9
10const char *CeedGitVersion = CEED_GIT_VERSION;
11const char *CeedBuildConfiguration = CEED_BUILD_CONFIGURATION;
12
13/// @addtogroup CeedUser
14/// @{
15
16/**
1// Copyright (c) 2017-2025, Lawrence Livermore National Security, LLC and other CEED contributors.
2// All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
3//
4// SPDX-License-Identifier: BSD-2-Clause
5//
6// This file is part of CEED: http://github.com/ceed
7
8#include <ceed-impl.h>
9
10const char *CeedGitVersion = CEED_GIT_VERSION;
11const char *CeedBuildConfiguration = CEED_BUILD_CONFIGURATION;
12
13/// @addtogroup CeedUser
14/// @{
15
16/**
17 @brief Get output of `git describe --dirty` from build time
17 @brief Get output of `git describe --dirty` from build time.
18
18
19 While @ref CeedGetVersion() uniqely identifies the source code for release
19 While @ref CeedGetVersion() uniquely identifies the source code for release
20 builds, it does not identify builds from other commits.
21
22 @param[out] git_version A static string containing the Git commit description.
23
24 If `git describe --always --dirty` fails, the string `"unknown"` will be provided.
25 This could occur if Git is not installed or if libCEED is not being built from a repository, for example.`
26
20 builds, it does not identify builds from other commits.
21
22 @param[out] git_version A static string containing the Git commit description.
23
24 If `git describe --always --dirty` fails, the string `"unknown"` will be provided.
25 This could occur if Git is not installed or if libCEED is not being built from a repository, for example.`
26
27 @return An error code: 0 - success, otherwise - failure
28
29 @ref Developer
30
31 @sa CeedGetVersion() CeedGetBuildConfiguration()
27 @ref Developer
28
29 @sa CeedGetVersion() CeedGetBuildConfiguration()
30
31 @return An error code: 0 - success, otherwise - failure
32*/
33int CeedGetGitVersion(const char **git_version) {
34 *git_version = CeedGitVersion;
35 return CEED_ERROR_SUCCESS;
36}
37
38/**
32*/
33int CeedGetGitVersion(const char **git_version) {
34 *git_version = CeedGitVersion;
35 return CEED_ERROR_SUCCESS;
36}
37
38/**
39 @brief Get build variables as a multi-line string
39 @brief Get build variables as a multi-line string.
40
41 Each line of the string has the format `VARNAME = value`.
42
43 @param[out] build_config A static string containing build variables
44
40
41 Each line of the string has the format `VARNAME = value`.
42
43 @param[out] build_config A static string containing build variables
44
45 @return An error code: 0 - success, otherwise - failure
46
47 @ref Developer
48
49 @sa CeedGetVersion() CeedGetGitVersion()
45 @ref Developer
46
47 @sa CeedGetVersion() CeedGetGitVersion()
48
49 @return An error code: 0 - success, otherwise - failure
50*/
51int CeedGetBuildConfiguration(const char **build_config) {
52 *build_config = CeedBuildConfiguration;
53 return CEED_ERROR_SUCCESS;
54}
55
56/// @}
50*/
51int CeedGetBuildConfiguration(const char **build_config) {
52 *build_config = CeedBuildConfiguration;
53 return CEED_ERROR_SUCCESS;
54}
55
56/// @}