Skip to content

Commit

Permalink
chore: move C++ format configuration (#2554)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Jim Pivarski <jpivarski@users.noreply.github.com>
  • Loading branch information
3 people authored Jul 3, 2023
1 parent f1d0844 commit 745a810
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 14 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 4 additions & 2 deletions header-only/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE
# BSD 3-Clause License; see
# https://github.com/scikit-hep/awkward/blob/main/LICENSE

cmake_minimum_required(VERSION 3.15...3.24)

Expand All @@ -15,7 +16,8 @@ option(BUILD_TESTS OFF)
# Add aliases for `add_subdirectory`
set(NAMESPACE "awkward::")

# We want to specify different compile options, so we split the headers into "components"
# We want to specify different compile options, so we split the headers into
# "components"
macro(add_component name)
add_library(${name} INTERFACE)
add_library(${NAMESPACE}${name} ALIAS ${name})
Expand Down
10 changes: 6 additions & 4 deletions header-only/examples/cython/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ include(FetchContent)
set(AWKWARD_VERSION "v2.0.10")
FetchContent_Declare(
awkward-headers
URL https://github.com/scikit-hep/awkward/releases/download/${AWKWARD_VERSION}/header-only.zip)
# Instead of using `FetchContent_MakeAvailable(awkward-headers)`, we manually load the target so
# that we can EXCLUDE_FROM_ALL
URL https://github.com/scikit-hep/awkward/releases/download/${AWKWARD_VERSION}/header-only.zip
)
# Instead of using `FetchContent_MakeAvailable(awkward-headers)`, we manually
# load the target so that we can EXCLUDE_FROM_ALL
FetchContent_GetProperties(awkward-headers)
if(NOT awkward-headers_POPULATED)
FetchContent_Populate(awkward-headers)
add_subdirectory(${awkward-headers_SOURCE_DIR} ${awkward-headers_BINARY_DIR} EXCLUDE_FROM_ALL)
add_subdirectory(${awkward-headers_SOURCE_DIR} ${awkward-headers_BINARY_DIR}
EXCLUDE_FROM_ALL)
endif()

find_package(Cython REQUIRED)
Expand Down
10 changes: 6 additions & 4 deletions header-only/examples/pybind11/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ include(FetchContent)
set(AWKWARD_VERSION "v2.0.10")
FetchContent_Declare(
awkward-headers
URL https://github.com/scikit-hep/awkward/releases/download/${AWKWARD_VERSION}/header-only.zip)
# Instead of using `FetchContent_MakeAvailable(awkward-headers)`, we manually load the target so
# that we can EXCLUDE_FROM_ALL
URL https://github.com/scikit-hep/awkward/releases/download/${AWKWARD_VERSION}/header-only.zip
)
# Instead of using `FetchContent_MakeAvailable(awkward-headers)`, we manually
# load the target so that we can EXCLUDE_FROM_ALL
FetchContent_GetProperties(awkward-headers)
if(NOT awkward-headers_POPULATED)
FetchContent_Populate(awkward-headers)
add_subdirectory(${awkward-headers_SOURCE_DIR} ${awkward-headers_BINARY_DIR} EXCLUDE_FROM_ALL)
add_subdirectory(${awkward-headers_SOURCE_DIR} ${awkward-headers_BINARY_DIR}
EXCLUDE_FROM_ALL)
endif()

# Load interpreter & pybind11
Expand Down
9 changes: 6 additions & 3 deletions header-only/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE
# BSD 3-Clause License; see
# https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE

macro(addtest_nolibs name filename)
add_executable(${name} ${filename})
Expand All @@ -16,5 +17,7 @@ addtest_nolibs(test_1542-growable-buffer test_1542-growable-buffer.cpp)
addtest_nolibs(test_1560-builder-options test_1560-builder-options.cpp)

target_link_libraries(test_1494-layout-builder PRIVATE awkward::layout-builder)
target_link_libraries(test_1542-growable-buffer PRIVATE awkward::growable-buffer)
target_link_libraries(test_1560-builder-options PRIVATE awkward::builder-options)
target_link_libraries(test_1542-growable-buffer
PRIVATE awkward::growable-buffer)
target_link_libraries(test_1560-builder-options
PRIVATE awkward::builder-options)
1 change: 0 additions & 1 deletion runtime.txt

This file was deleted.

0 comments on commit 745a810

Please sign in to comment.