Skip to content

Commit

Permalink
build: upgrade to conan 2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
dvirtz committed Sep 20, 2023
1 parent 32857de commit 655dab3
Show file tree
Hide file tree
Showing 7 changed files with 519 additions and 152 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ jobs:
windows-latest,
]
env:
CONAN_USER_HOME: "${{ github.workspace }}/conan-cache"
CONAN_USER_HOME_SHORT: "${{ github.workspace }}/conan-cache/short"
CONAN_HOME: "${{ github.workspace }}/conan-cache"
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
Expand Down Expand Up @@ -51,7 +50,7 @@ jobs:
- name: Cache .conan
uses: actions/cache@v3
with:
path: ${{ env.CONAN_USER_HOME }}
path: ${{ env.CONAN_HOME }}
key: ${{ runner.os }}-conan-${{ hashFiles('packages/parquet-reader/conanfile.txt') }}
- run: npm ci
- name: Static checks
Expand Down
41 changes: 5 additions & 36 deletions packages/parquet-reader/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,46 +1,16 @@
cmake_minimum_required(VERSION 3.24)
cmake_policy(SET CMP0042 NEW)

set(CMAKE_CXX_STANDARD 17)
# Current oldest supported version according to https://endoflife.date/macos
set(CMAKE_OSX_DEPLOYMENT_TARGET 11.0)

project(arrow-parquet-reader)

set(NAPI_VERSION 6)

################# dependencies #################

set(CONAN_CMAKE_VERSION 0.18.1)
if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan-${CONAN_CMAKE_VERSION}.cmake")
message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan")
file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/${CONAN_CMAKE_VERSION}/conan.cmake"
"${CMAKE_BINARY_DIR}/conan-${CONAN_CMAKE_VERSION}.cmake" TLS_VERIFY ON)
endif()

set_directory_properties(PROPERTIES CMAKE_CONFIGURE_DEPENDS conanfile.txt)

include(${CMAKE_BINARY_DIR}/conan-${CONAN_CMAKE_VERSION}.cmake)

conan_cmake_autodetect(settings)
if(CMAOE_BUILD_TYPE STREQUAL Debug)
set(COMPILER_RUNTIME MTD)
else()
set(COMPILER_RUNTIME MT)
endif()
list(TRANSFORM settings REPLACE "compiler.runtime=.*" "compiler.runtime=${COMPILER_RUNTIME}")

conan_cmake_install(
PATH_OR_REFERENCE
${CMAKE_SOURCE_DIR}
BUILD
missing
SETTINGS
${settings})

list(APPEND CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR})

find_package(Arrow REQUIRED CONFIG)
find_package(fmt REQUIRED CONFIG)
find_package(re2 REQUIRED CONFIG)

################################################

set(SOURCE_FILES addon.cpp)
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES} ${CMAKE_JS_SRC})
Expand All @@ -49,8 +19,7 @@ target_link_libraries(
${PROJECT_NAME}
PRIVATE ${CMAKE_JS_LIB}
fmt::fmt
arrow::libparquet
re2::re2)
arrow::libparquet)

# Include Node-API wrappers
execute_process(
Expand Down
2 changes: 1 addition & 1 deletion packages/parquet-reader/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ verify_ssl = true
name = "pypi"

[packages]
conan = "<2.0"
conan = "*"
cmake = "*"

[dev-packages]
Expand Down
183 changes: 75 additions & 108 deletions packages/parquet-reader/Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 655dab3

Please sign in to comment.