2022-01-31 18:02:14 +08:00
|
|
|
# Copyright 2022 Google LLC
|
|
|
|
#
|
|
|
|
# Licensed 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
|
|
|
|
#
|
|
|
|
# https://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.13..3.22)
|
|
|
|
|
|
|
|
project(sapi_blosc CXX)
|
2022-04-21 16:14:48 +08:00
|
|
|
include(CTest)
|
2022-06-10 21:15:03 +08:00
|
|
|
include(GoogleTest)
|
2022-01-31 18:02:14 +08:00
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
|
|
|
|
|
|
|
if(NOT TARGET sapi::sapi)
|
|
|
|
set(SAPI_ROOT "../.." CACHE PATH "Path to the Sandboxed API source tree")
|
2022-06-10 21:15:03 +08:00
|
|
|
add_subdirectory("${SAPI_ROOT}"
|
|
|
|
"${CMAKE_BINARY_DIR}/sandboxed-api-build"
|
|
|
|
EXCLUDE_FROM_ALL)
|
2022-01-31 18:02:14 +08:00
|
|
|
endif()
|
|
|
|
|
2022-06-10 21:15:03 +08:00
|
|
|
FetchContent_Declare(libblosc
|
|
|
|
GIT_REPOSITORY https://github.com/Blosc/c-blosc.git
|
|
|
|
GIT_TAG ad6361f0151f830efb5ae113211c3559ab969886 # 2022-05-31
|
|
|
|
)
|
2022-03-04 08:07:45 +08:00
|
|
|
set(HIDE_SYMBOLS OFF CACHE BOOL "" FORCE)
|
2022-04-29 17:13:32 +08:00
|
|
|
set(BUILD_BENCHMARKS OFF CACHE BOOL "" FORCE)
|
|
|
|
set(BUILD_FUZZERS OFF CACHE BOOL "" FORCE)
|
|
|
|
set(BUILD_TESTS OFF CACHE BOOL "" FORCE)
|
2022-01-31 18:02:14 +08:00
|
|
|
FetchContent_MakeAvailable(libblosc)
|
|
|
|
|
2022-04-29 17:13:32 +08:00
|
|
|
add_sapi_library(sapi_blosc
|
|
|
|
FUNCTIONS blosc_init
|
|
|
|
blosc_destroy
|
2022-01-31 18:02:14 +08:00
|
|
|
|
2022-04-29 17:13:32 +08:00
|
|
|
blosc_compress
|
|
|
|
blosc_decompress
|
2022-01-31 18:02:14 +08:00
|
|
|
|
2022-04-29 17:13:32 +08:00
|
|
|
blosc_get_nthreads
|
|
|
|
blosc_set_nthreads
|
2022-01-31 18:02:14 +08:00
|
|
|
|
2022-04-29 17:13:32 +08:00
|
|
|
blosc_get_compressor
|
|
|
|
blosc_set_compressor
|
2022-01-31 18:02:14 +08:00
|
|
|
|
2022-04-29 17:13:32 +08:00
|
|
|
blosc_list_compressors
|
2022-01-31 18:02:14 +08:00
|
|
|
|
2022-04-29 17:13:32 +08:00
|
|
|
blosc_get_version_string
|
2022-01-31 18:02:14 +08:00
|
|
|
|
2022-04-29 17:13:32 +08:00
|
|
|
blosc_get_blocksize
|
|
|
|
blosc_set_blocksize
|
2022-01-31 18:02:14 +08:00
|
|
|
|
2022-04-29 17:13:32 +08:00
|
|
|
blosc_set_splitmode
|
2022-01-31 18:02:14 +08:00
|
|
|
|
2022-04-29 17:13:32 +08:00
|
|
|
blosc_cbuffer_sizes
|
|
|
|
blosc_cbuffer_validate
|
|
|
|
blosc_cbuffer_versions
|
|
|
|
INPUTS "${libblosc_SOURCE_DIR}/blosc/blosc.h"
|
2022-01-31 18:02:14 +08:00
|
|
|
LIBRARY blosc_static
|
|
|
|
LIBRARY_NAME Cblosc
|
|
|
|
NAMESPACE ""
|
|
|
|
)
|
|
|
|
add_library(sapi_contrib::blosc ALIAS sapi_blosc)
|
|
|
|
target_include_directories(sapi_blosc INTERFACE
|
|
|
|
"${PROJECT_BINARY_DIR}"
|
|
|
|
)
|
|
|
|
|
2022-04-21 16:17:08 +08:00
|
|
|
if (SAPI_BUILD_EXAMPLES)
|
2022-01-31 18:02:14 +08:00
|
|
|
add_subdirectory(example)
|
|
|
|
endif()
|
|
|
|
|
2022-04-21 16:17:08 +08:00
|
|
|
if (BUILD_TESTING AND SAPI_BUILD_TESTING)
|
2022-01-31 18:02:14 +08:00
|
|
|
add_subdirectory(test)
|
|
|
|
endif()
|