Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CHDB_VERSION for cmake #96

Merged
merged 1 commit into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions chdb/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_THINLTO=0 -DENABLE_TESTS=0 -DENABLE_CL
${CPU_FEATURES} \
${CMAKE_TOOLCHAIN_FILE} \
-DENABLE_AVX512=0 -DENABLE_AVX512_VBMI=0 \
-DCHDB_VERSION=${CHDB_VERSION} \
..
ninja

Expand Down
5 changes: 4 additions & 1 deletion chdb/vars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ BUILD_DIR="$PROJ_DIR/buildlib" # build directory
CHDB_DIR="$PROJ_DIR/chdb" # chdb directory
CHDB_PY_MOD="_chdb"
CHDB_PY_MODULE=${CHDB_PY_MOD}$(python3 -c "import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'))")
pushd ${PROJ_DIR}
CHDB_VERSION=$(python3 -c 'import setup; print(setup.get_latest_git_tag())')
popd

# check current os type, and make ldd command
if [ "$(uname)" == "Darwin" ]; then
Expand All @@ -14,4 +17,4 @@ elif [ "$(uname)" == "Linux" ]; then
else
echo "OS not supported"
exit 1
fi
fi
14 changes: 8 additions & 6 deletions src/Functions/chdbVersion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <DataTypes/DataTypeString.h>
#include <Functions/FunctionFactory.h>
#include <Functions/FunctionConstantBase.h>
#include <Common/FunctionDocumentation.h>

namespace DB
{
Expand All @@ -21,14 +22,15 @@ namespace

REGISTER_FUNCTION(ChdbVersion)
{
factory.registerFunction<FunctionChdbVersion>(
factory.registerFunction<FunctionChdbVersion>(FunctionDocumentation
{
R"(
.description=R"(
Returns the version of chDB. The result type is String.
)",
Documentation::Examples{{"chdb", "SELECT chdb()"}},
Documentation::Categories{"String"}
}, FunctionFactory::CaseInsensitive);
)",
.examples{{"chdb", "SELECT chdb();", ""}},
.categories{"String"}
},
FunctionFactory::CaseInsensitive);
}
}
#endif