Skip to content

Commit

Permalink
Make compile for v.10.2 and v.10.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Joachim Rosskopf committed May 25, 2024
1 parent 62fdf19 commit f534dae
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 5 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/MainDistributionPipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,25 @@ jobs:
deploy_latest: ${{ startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master' }}
deploy_versioned: ${{ !(startsWith(github.ref, 'refs/tags/v')) && !(github.ref == 'refs/heads/master') }}

duckdb-stable-build-v0103:
name: Build v.0.10.3 extension binaries
uses: ./.github/workflows/_extension_build.yml
with:
duckdb_version: v0.10.3
extension_name: erpl
exclude_archs: osx_amd64;osx_arm64;linux_arm64;windows_amd64_rtools;wasm_mvp;wasm_eh;wasm_threads
vcpkg_commit: 9edb1b8e590cc086563301d735cae4b6e732d2d2
secrets: inherit

duckdb-stable-deploy-v0103:
name: Deploy extension binaries
needs: duckdb-stable-build-v0103
uses: ./.github/workflows/_extension_deploy.yml
secrets: inherit
with:
duckdb_version: v0.10.3
extension_name: erpl
exclude_archs: osx_amd64;osx_arm64;linux_arm64;windows_amd64_rtools;wasm_mvp;wasm_eh;wasm_threads
deploy_latest: ${{ startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master' }}
deploy_versioned: ${{ !(startsWith(github.ref, 'refs/tags/v')) && !(github.ref == 'refs/heads/master') }}

2 changes: 1 addition & 1 deletion bics
Submodule bics updated from 4a328b to 0f307e
2 changes: 1 addition & 1 deletion odp
Submodule odp updated from 6da5bc to 7ed99f
2 changes: 1 addition & 1 deletion rfc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
project(${TARGET_NAME})

include(../scripts/functions.cmake)
add_duckdb_version_definition()

if(WIN32)
default_win32_libraries()
Expand All @@ -27,7 +28,6 @@ include_directories(src/include
${SAPNWRFC_HOME}/include
${OPENSSL_INCLUDE_DIR})


add_yyjson_from_duckdb()

set(EXTENSION_SOURCES
Expand Down
8 changes: 7 additions & 1 deletion rfc/src/sap_rfc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,13 @@ namespace duckdb
duckdb::shared_ptr<RfcReadColumnTask> RfcReadColumnStateMachine::CreateTaskForNextStep(ClientContext &client_context, duckdb::Vector &column_output)
{
std::lock_guard<mutex> t(thread_lock);
auto task = make_shared_ptr<RfcReadColumnTask>(this, client_context, column_output);

#if ((DUCKDB_MAJOR_VERSION>0) || (DUCKDB_MAJOR_VERSION==0 && DUCKDB_MINOR_VERSION>10) || (DUCKDB_MAJOR_VERSION==0 && DUCKDB_MINOR_VERSION==10 && DUCKDB_PATCH_VERSION>=3))
auto task = duckdb::make_shared_ptr<RfcReadColumnTask>(this, client_context, column_output);
#else
auto task = duckdb::make_shared<RfcReadColumnTask>(this, client_context, column_output);
#endif

return task;
}

Expand Down
9 changes: 8 additions & 1 deletion scripts/functions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ function(add_yyjson_from_duckdb)
get_filename_component(yyjson_ext "${PROJECT_SOURCE_DIR}/../duckdb/extension/json/yyjson" REALPATH)
if(EXISTS "${yyjson_ext}")
include_directories(../duckdb/extension/json/yyjson/include/)
add_subdirectory(../duckdb/extension/json/yyjson/)
message (NOTICE "-- Using yyjson extension from ${yyjson_ext}")
endif()

Expand All @@ -183,4 +182,12 @@ function(add_yyjson_from_duckdb)
add_compile_definitions(DUCKDB_YYJSON_THIRDPARTY)
message(NOTICE "-- Using yyjson third party from ${yyjson_thirdparty}")
endif()
endfunction()

#---------------------------------------------------------------------------------------

function(add_duckdb_version_definition)
add_compile_definitions(DUCKDB_MAJOR_VERSION=${DUCKDB_MAJOR_VERSION})
add_compile_definitions(DUCKDB_MINOR_VERSION=${DUCKDB_MINOR_VERSION})
add_compile_definitions(DUCKDB_PATCH_VERSION=${DUCKDB_PATCH_VERSION})
endfunction()
1 change: 1 addition & 0 deletions trampoline/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
project(${TARGET_NAME})

include(../scripts/functions.cmake)
add_duckdb_version_definition()

if(WIN32)
# Attach the erpl_rfc.duckdb_extension file as a resource to the trampoline file
Expand Down

0 comments on commit f534dae

Please sign in to comment.