Skip to content

Commit

Permalink
gen and use config header
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrush committed Nov 22, 2024
1 parent 1ab134a commit a1207e6
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/libs/logging/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
# Project developers. See top-level LICENSE AND COPYRIGHT files for dates and
# other details. No copyright assignment is required to contribute to Ascent.

# gen config header
configure_file ("${CMAKE_CURRENT_SOURCE_DIR}/ascent_logging_config.h.in"
"${CMAKE_CURRENT_BINARY_DIR}/ascent_logging_config.h")

set(ascent_logging_headers
${CMAKE_CURRENT_BINARY_DIR}/ascent_logging_config.h
ascent_logging.hpp
ascent_logging_timer.hpp
ascent_annotations.hpp
Expand All @@ -27,10 +32,11 @@ blt_add_library(NAME ascent_logging
HEADERS ${aascent_logging_headers}
DEPENDS_ON ${ascent_logging_deps})

# for generated config header
target_include_directories(ascent_logging PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
target_include_directories(ascent_logging PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/libs/logging>)

# extra defs and props
target_compile_definitions(ascent_logging PUBLIC ASCENT_LOGGING_ENABLE_CALIPER)
target_compile_definitions(ascent_logging PRIVATE ASCENT_EXPORTS_FLAG)

if(ENABLE_HIDDEN_VISIBILITY)
Expand Down
1 change: 1 addition & 0 deletions src/libs/logging/ascent_annotations.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
// -- ascent includes --
//-----------------------------------------------------------------------------
#include <ascent_logging_exports.h>
#include <ascent_logging_config.h>
#include <conduit.hpp>

//-----------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions src/libs/logging/ascent_logging.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#define ASCENT_LOGGING_HPP

#include <ascent_logging_exports.h>
#include <ascent_logging_config.h>
#include <ascent_annotations.hpp>
#include <ascent_logging_timer.hpp>

Expand Down
19 changes: 19 additions & 0 deletions src/libs/logging/ascent_logging_config.h.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
// Copyright (c) Lawrence Livermore National Security, LLC and other Ascent
// Project developers. See top-level LICENSE AND COPYRIGHT files for dates and
// other details. No copyright assignment is required to contribute to Ascent.
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//


//-----------------------------------------------------------------------------
///
/// file: ascent_logging_config.h
///
//-----------------------------------------------------------------------------

#ifndef ASCENT_LOGGING_CONFIG_H
#define ASCENT_LOGGING_CONFIG_H

#cmakedefine ASCENT_LOGGING_CALIPER_ENABLED "@CALIPER_FOUND@"

#endif

0 comments on commit a1207e6

Please sign in to comment.