# 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.
add_subdirectory(tpch)

add_compile_definitions(DISABLE_DUCKDB_REMOTE_INSTALL)
add_compile_definitions(BUILD_PARQUET_EXTENSION)

# Certain Clang compiler versions throw "deprecated declarations" warnings for
# DuckDB's parquet-amalgamation.h. This warning is from the Thrift library
# that DuckDB embeds and is also on Thrift master.
# The workaround, for now, is to disable this warning if the compiler is Clang.
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  add_compile_options(-Wno-deprecated-declarations)
endif()

# This stringop-overflow warning seems to have lots of false positives and has
# been the source of a lot of compiler bug reports
# (e.g. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578), which causes
# parquet-amalgamation.cpp to fail to compile. For now, we disable this warning
# on the affected compiler (GCC). 
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
  add_compile_options(-Wno-stringop-overflow)
endif()

add_library(
  duckdb
  duckdb-1.cpp
  duckdb-2.cpp
  duckdb-3.cpp
  duckdb-4.cpp
  duckdb-5.cpp
  duckdb-6.cpp
  duckdb-7.cpp
  duckdb-8.cpp
  duckdb-fastpforlib.cpp
  duckdb-fmt.cpp
  duckdb-hyperloglog.cpp
  duckdb-libpg_query.cpp
  duckdb-miniz.cpp
  duckdb-re2.cpp
  duckdb-utf8proc.cpp
  parquet-amalgamation.cpp)

set_property(TARGET duckdb PROPERTY JOB_POOL_COMPILE high_memory_pool)
