diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..77a255d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,64 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +name: CI + +on: + pull_request: + push: + branches: + - main + +permissions: + contents: read + +jobs: + pre-commit: + name: Pre-commit + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" + + - name: Install pre-commit + run: python -m pip install pre-commit + + - name: Run pre-commit hooks + run: pre-commit run --all-files + + cmake: + name: CMake configure + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Install build tools + run: | + sudo apt-get update + sudo apt-get install -y ninja-build + + - name: Configure + run: cmake -S . -B build -G Ninja -DPAIMON_BUILD_TESTS=ON + + - name: Build + run: cmake --build build --parallel diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..caae778 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,34 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +cmake_minimum_required(VERSION 3.16) +project(paimon VERSION 0.1.0 LANGUAGES C CXX) + +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules") + +include(GNUInstallDirs) +include(DefineOptions) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) + +include(san-config) + +if(PAIMON_BUILD_TESTS) + enable_testing() +endif() diff --git a/NOTICE b/NOTICE index 9160245..d99f754 100644 --- a/NOTICE +++ b/NOTICE @@ -15,4 +15,4 @@ Copyright (c) 2011-present, Facebook, Inc. All rights reserved. Copyright (c) 2011 The LevelDB Authors. All rights reserved. This product includes software from cppjieba project (MIT) -Copyright 2013 \ No newline at end of file +Copyright 2013 diff --git a/cmake_modules/ThirdpartyToolchain.cmake b/cmake_modules/ThirdpartyToolchain.cmake index 8e96db7..669301b 100644 --- a/cmake_modules/ThirdpartyToolchain.cmake +++ b/cmake_modules/ThirdpartyToolchain.cmake @@ -421,9 +421,12 @@ function(paimon_enforce_patched_dependency_policy) elseif(_arrow_source STREQUAL "AUTO") message(STATUS "Forcing Arrow_SOURCE to BUNDLED because paimon-cpp requires " "project-specific Arrow patches") - set(Arrow_SOURCE "BUNDLED" + set(Arrow_SOURCE + "BUNDLED" CACHE STRING "Dependency source for Arrow" FORCE) - set(Arrow_SOURCE "BUNDLED" PARENT_SCOPE) + set(Arrow_SOURCE + "BUNDLED" + PARENT_SCOPE) endif() if(PAIMON_ENABLE_ORC) @@ -435,9 +438,12 @@ function(paimon_enforce_patched_dependency_policy) elseif(_orc_source STREQUAL "AUTO") message(STATUS "Forcing ORC_SOURCE to BUNDLED because paimon-cpp requires " "project-specific ORC patches") - set(ORC_SOURCE "BUNDLED" + set(ORC_SOURCE + "BUNDLED" CACHE STRING "Dependency source for ORC" FORCE) - set(ORC_SOURCE "BUNDLED" PARENT_SCOPE) + set(ORC_SOURCE + "BUNDLED" + PARENT_SCOPE) endif() endif() endfunction()