Skip to content

Commit

Permalink
Merge pull request #111 from Altinity/customizations/21.8
Browse files Browse the repository at this point in the history
Customizations/21.8
  • Loading branch information
Enmk authored Dec 29, 2021
2 parents b3d03e5 + 4bf7153 commit e7c6f67
Show file tree
Hide file tree
Showing 15 changed files with 532 additions and 228 deletions.
8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ if (CMAKE_GENERATOR STREQUAL "Ninja" AND NOT DISABLE_COLORED_BUILD)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color=always")
endif ()

include (cmake/check_flags.cmake)
include (cmake/add_warning.cmake)

if (NOT MSVC)
Expand All @@ -165,6 +166,10 @@ if (COMPILER_CLANG)
endif ()
endif ()

if (HAS_RESERVED_IDENTIFIER)
add_compile_definitions (HAS_RESERVED_IDENTIFIER)
endif ()

# If turned `ON`, assumes the user has either the system GTest library or the bundled one.
option(ENABLE_TESTS "Provide unit_test_dbms target with Google.Test unit tests" ON)
option(ENABLE_EXAMPLES "Build all example programs in 'examples' subdirectories" OFF)
Expand Down Expand Up @@ -605,9 +610,6 @@ include_directories(${ConfigIncludePath})
# Add as many warnings as possible for our own code.
include (cmake/warnings.cmake)

# Check if needed compiler flags are supported
include (cmake/check_flags.cmake)

add_subdirectory (base)
add_subdirectory (src)
add_subdirectory (programs)
Expand Down
4 changes: 4 additions & 0 deletions base/common/unit.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#pragma once
#include <cstddef>

#ifdef HAS_RESERVED_IDENTIFIER
#pragma clang diagnostic ignored "-Wreserved-identifier"
#endif

constexpr size_t KiB = 1024;
constexpr size_t MiB = 1024 * KiB;
constexpr size_t GiB = 1024 * MiB;
Expand Down
3 changes: 3 additions & 0 deletions base/common/wide_integer_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
#include <cassert>
#include <limits>

#ifdef HAS_RESERVED_IDENTIFIER
#pragma clang diagnostic ignored "-Wreserved-identifier"
#endif

namespace wide
{
Expand Down
1 change: 1 addition & 0 deletions cmake/check_flags.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
include (CheckCXXCompilerFlag)
include (CheckCCompilerFlag)

check_cxx_compiler_flag("-Wreserved-identifier" HAS_RESERVED_IDENTIFIER)
check_cxx_compiler_flag("-Wsuggest-destructor-override" HAS_SUGGEST_DESTRUCTOR_OVERRIDE)
check_cxx_compiler_flag("-Wshadow" HAS_SHADOW)
check_cxx_compiler_flag("-Wsuggest-override" HAS_SUGGEST_OVERRIDE)
Loading

0 comments on commit e7c6f67

Please sign in to comment.