Skip to content

Commit

Permalink
tryout ld
Browse files Browse the repository at this point in the history
  • Loading branch information
hafenkran committed Jul 9, 2024
1 parent 8b0bfad commit 2687408
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/MainDistributionPipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ jobs:
duckdb_version: v1.0.0
extension_name: bigquery
exclude_archs: 'wasm_mvp;wasm_eh;wasm_threads;windows_amd64_rtools'
vcpkg_commit: 'a4275b7eee79fb24ec2e135481ef5fce8b41c339'
# vcpkg_commit: 'a4275b7eee79fb24ec2e135481ef5fce8b41c339'
vcpkg_commit: '9e6ab1f514cb9a8fc6693bafccc4e97edba210b2'

duckdb-stable-deploy:
name: Deploy extension binaries
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/_extension_distribution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,8 @@ jobs:
git clone https://github.com/hafenkran/vcpkg.git
cd vcpkg
# git fetch
git fetch
git checkout 9e6ab1f514cb9a8fc6693bafccc4e97edba210b2
# git checkout f7d13cb679898dbe65fd5cf1cab43bd013feb092
#export CC="${CC}"
#export CXX="${CXX}"
Expand Down Expand Up @@ -529,7 +531,7 @@ jobs:
- name: Setup vcpkg
uses: lukka/[email protected]
with:
vcpkgUrl: https://github.com/hafenkran/vcpkg
vcpkgGitURL: https://github.com/hafenkran/vcpkg
vcpkgGitCommitId: ${{ inputs.vcpkg_commit }}

- name: Install Rust cross compile dependency
Expand Down Expand Up @@ -624,6 +626,7 @@ jobs:
- name: Setup vcpkg
uses: lukka/[email protected]
with:
vcpgkGitURL: https://github.com/hafenkran/vcpkg.git
vcpkgGitCommitId: ${{ inputs.vcpkg_commit }}

# - name: Install SSL Certificates
Expand Down
26 changes: 21 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.25.1)

# Set extension name here
set(TARGET_NAME bigquery)
# set(CMAKE_OSX_DEPLOYMENT_TARGET 14.0)
set(CMAKE_OSX_DEPLOYMENT_TARGET 11.0)

# Compile and install google-cloud-cpp depedencies
message("Installing google-cloud-cpp dependencies")
Expand All @@ -13,7 +13,6 @@ execute_process(
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DVCPKG_MANIFEST_DIR=${VCPKG_MANIFEST_DIR}
-DVCPKG_INSTALLED_DIR=${CMAKE_BINARY_DIR}/vcpkg_installed
# -DVCPKG_INSTALLED_DIR=${VCPKG_INSTALLED_DIR}
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-DOSX_BUILD_ARCH=${OSX_BUILD_ARCH}
-DCMAKE_OSX_ARCHITECTURES=${DCMAKE_OSX_ARCHITECTURES}
Expand Down Expand Up @@ -43,9 +42,11 @@ set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${CMAKE_BINARY_DIR}/external/local)

set(EXTENSION_NAME ${TARGET_NAME}_extension)
set(LOADABLE_EXTENSION_NAME ${TARGET_NAME}_loadable_extension)
set(INCLUDE_VC_DIR ${CMAKE_BINARY_DIR}/vcpkg_installed/${VCPKG_TARGET_TRIPLET}/include/)

project(${TARGET_NAME})
include_directories(src/include)
include_directories(${INCLUDE_VC_DIR})
add_subdirectory(src)

include(${CMAKE_TOOLCHAIN_FILE})
Expand All @@ -56,26 +57,41 @@ find_package(gRPC CONFIG REQUIRED)
find_package(Protobuf CONFIG REQUIRED)
find_package(Arrow REQUIRED)
find_package(OpenSSL REQUIRED)
find_package(google_cloud_cpp_common REQUIRED)
find_package(google_cloud_cpp_bigquery REQUIRED)
find_package(google_cloud_cpp_bigquery_rest REQUIRED)

build_static_extension(${TARGET_NAME} ${EXTENSION_SOURCES})
build_loadable_extension(${TARGET_NAME} " " ${EXTENSION_SOURCES})

# Link OpenSSL in both the static library as the loadable extension
# ${Protobuf_LIBRARIES}

target_include_directories(${LOADABLE_EXTENSION_NAME}
PRIVATE include ${INCLUDE_VC_DIR})

target_link_libraries(${EXTENSION_NAME}
OpenSSL::SSL
OpenSSL::Crypto
google-cloud-cpp::common
google-cloud-cpp::bigquery
google-cloud-cpp::experimental-bigquery_rest
google-cloud-cpp::grpc_utils
absl::base
absl::memory
absl::status
absl::variant
"$<IF:$<BOOL:${ARROW_BUILD_STATIC}>,Arrow::arrow_static,Arrow::arrow_shared>")

target_link_libraries(${LOADABLE_EXTENSION_NAME}
OpenSSL::SSL
OpenSSL::Crypto
google-cloud-cpp::common
google-cloud-cpp::bigquery
google-cloud-cpp::experimental-bigquery_rest
google-cloud-cpp::experimental-bigquery_rest
google-cloud-cpp::grpc_utils
absl::base
absl::memory
absl::status
absl::variant
"$<IF:$<BOOL:${ARROW_BUILD_STATIC}>,Arrow::arrow_static,Arrow::arrow_shared>")

install(
Expand Down
1 change: 1 addition & 0 deletions external/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ project(dependencies-build)
include(ExternalProject)
set(LOCAL_INSTALL_DIR ${CMAKE_BINARY_DIR}/local)
set_directory_properties(PROPERTIES EP_BASE ${CMAKE_BINARY_DIR}/projects)
set(CMAKE_OSX_DEPLOYMENT_TARGET "11.0")

if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.24.0")
cmake_policy(SET CMP0135 NEW)
Expand Down
11 changes: 10 additions & 1 deletion vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,14 @@
"features": [
"ssl"
]
},
{
"name": "google-cloud-cpp",
"features": ["bigquery", "grpc-common", "storage"],
"default-features": false
}
],
"builtin-baseline": "f7d13cb679898dbe65fd5cf1cab43bd013feb092",
"builtin-baseline": "9e6ab1f514cb9a8fc6693bafccc4e97edba210b2",
"overrides": [
{
"name": "abseil",
Expand All @@ -28,6 +33,10 @@
{
"name": "arrow",
"version": "16.1.0"
},
{
"name": "google-cloud-cpp",
"version": "2.23.0"
}
]
}

0 comments on commit 2687408

Please sign in to comment.