Skip to content

Commit

Permalink
Define KUZU_VERSION as an extern global
Browse files Browse the repository at this point in the history
Since it's set using a compile definition, we want to avoid that definition being required to include the header
  • Loading branch information
benjaminwinger committed Nov 20, 2023
1 parent 46ad0f6 commit f32070b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ add_subdirectory(vector)

add_library(kuzu_common
OBJECT
constants.cpp
expression_type.cpp
file_utils.cpp
in_mem_overflow_buffer.cpp
Expand Down
6 changes: 6 additions & 0 deletions src/common/constants.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace kuzu {
namespace common {

const char* KUZU_VERSION = KUZU_CMAKE_VERSION;
}
} // namespace kuzu
2 changes: 1 addition & 1 deletion src/include/common/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace kuzu {
namespace common {

constexpr char KUZU_VERSION[] = KUZU_CMAKE_VERSION;
extern const char* KUZU_VERSION;

constexpr uint64_t DEFAULT_VECTOR_CAPACITY_LOG_2 = 11;
constexpr uint64_t DEFAULT_VECTOR_CAPACITY = (uint64_t)1 << DEFAULT_VECTOR_CAPACITY_LOG_2;
Expand Down

0 comments on commit f32070b

Please sign in to comment.