# ============================================================================
# Copyright 2017-2019, Schlumberger
# 
# 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
# 
#      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.
# ============================================================================

set(BENCHMARK_PATH ${CMAKE_SOURCE_DIR}/benchmarks/benchmark)

set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "Disable google-benchmark tests")
set(BENCHMARK_ENABLE_INSTALL OFF CACHE BOOL "Disable google-benchmark install")

add_subdirectory(${BENCHMARK_PATH})

add_executable(gcs_perf gcs_perf.cc
  GcsAccessor/ObjectExists.cc
  GcsAccessor/DownloadObject.cc
  GcsAccessor/UploadObject.cc
  GcsAccessor/DeleteObject.cc
  GcsAccessor/ObjectAttribute.cc
  GcsAccessor/Metadata.cc
  )
target_link_libraries(gcs_perf PRIVATE benchmark_main sdapi_static)

add_executable(sd_perf sd_perf.cc
  SDGenericDataset/Construct.cc
  SDGenericDataset/OpenClose.cc
  SDGenericDataset/Write.cc
  SDGenericDataset/Read.cc
  SDGenericDataset/Sizes.cc
  SDGenericDataset/Delete.cc
  )
target_include_directories(sd_perf PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/SDGenericDataset>)

if(NOT WIN32)
  target_link_libraries(sd_perf PRIVATE benchmark_main sdapi_static)
else()
  target_link_libraries(sd_perf PRIVATE benchmark_main sdapi)
endif()
