Skip to content

Commit a2ab045

Browse files
authored
Merge pull request #8 from bbalouki/bbs-dev
updates
2 parents ffc3865 + 8605186 commit a2ab045

File tree

19 files changed

+287
-208
lines changed

19 files changed

+287
-208
lines changed

.clang-format

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Standard: Latest
2121
IndentWidth: 4
2222
AlignConsecutiveAssignments: true
2323
AlignConsecutiveDeclarations: true
24-
AllowShortBlocksOnASingleLine: true
25-
AllowShortIfStatementsOnASingleLine: true
24+
AllowShortBlocksOnASingleLine: false
25+
AllowShortIfStatementsOnASingleLine: false
2626
PointerAlignment: Left
2727
ColumnLimit: 100

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ install/
99
*_ITCH50
1010
scripts.sh
1111
*Presets.json
12+
.cache/

CMakeLists.txt

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,37 @@
11
cmake_minimum_required(VERSION 3.20)
22

3-
include(${CMAKE_SOURCE_DIR}/cmake/Helpers.cmake)
4-
5-
project(ITCH VERSION "1.0.0" LANGUAGES CXX)
3+
project(ITCH VERSION "1.0.0")
64

7-
option(ITCH_CXX_STANDARD "C++ standard for the project" 20)
8-
set(CMAKE_CXX_STANDARD ${ITCH_CXX_STANDARD})
9-
set(CMAKE_CXX_STANDARD_REQUIRED ON)
10-
set(CMAKE_CXX_EXTENSIONS OFF)
5+
include(${CMAKE_SOURCE_DIR}/cmake/Helpers.cmake)
6+
include(${CMAKE_SOURCE_DIR}/cmake/Versions.cmake)
117

12-
if(ITCH_PROJECT_ENV STREQUAL "DEV")
13-
include(cmake/Tidy.cmake)
14-
include(cmake/Format.cmake)
15-
include(cmake/Coverage.cmake)
8+
if(${PROJECT_NAME}_ADD_COVERAGE_ANALYSIS)
9+
add_coverage_analysis()
10+
endif()
11+
if(${PROJECT_NAME}_APPLY_FORMATING)
12+
apply_formating(${PROJECT_NAME}_USE_PER_FILE_FORMATTING)
13+
endif()
14+
if(${PROJECT_NAME}_APPLY_CLANG_TIDY_GLOBALY)
15+
apply_clang_tidy_globaly()
16+
endif()
17+
if(${PROJECT_NAME}_BUILD_DOCUMENTATION)
18+
build_documenation()
19+
endif()
20+
if(${PROJECT_NAME}_ENABLE_ADDRESS_SANITIZER)
21+
anable_address_sanitizer()
1622
endif()
1723

18-
include(cmake/Sanitize.cmake)
1924
add_subdirectory(src)
2025

21-
if (ITCH_BUILD_TESTS)
26+
if (${PROJECT_NAME}_BUILD_TESTS)
2227
enable_testing()
2328
add_subdirectory(tests)
2429
endif()
25-
26-
if (ITCH_BUILD_BENCHMARKS)
30+
if (${PROJECT_NAME}_BUILD_BENCHMARKS)
2731
add_subdirectory(benchmarks)
2832
endif()
29-
30-
if (ITCH_BUILD_EXAMPLES)
33+
if (${PROJECT_NAME}_BUILD_EXAMPLES)
3134
add_subdirectory(examples)
3235
endif()
3336

37+

benchmarks/CMakeLists.txt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
cmake_minimum_required(VERSION 3.23)
22

3-
find_package(benchmark CONFIG REQUIRED)
3+
if(DEFINED CMAKE_TOOLCHAIN_FILE)
4+
find_package(benchmark CONFIG REQUIRED)
5+
else()
6+
set(FETCHCONTENT_BASE_DIR "${CMAKE_SOURCE_DIR}/.cache/_deps")
7+
include(FetchContent)
8+
FetchContent_Declare(
9+
benchmark
10+
GIT_REPOSITORY https://github.com/google/benchmark.git
11+
GIT_TAG "v${BENCHMARK_VERSION}"
12+
)
13+
FetchContent_MakeAvailable(benchmark)
14+
endif()
15+
416
add_executable(parser_bench parser_bench.cpp)
517
target_link_libraries(
618
parser_bench PRIVATE

benchmarks/parser_bench.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ int main(int argc, char** argv) {
128128
// Manually remove the filename argument from the list before passing to
129129
// benchmark::Initialize. We do this by shifting all subsequent arguments
130130
// one position to the left.
131-
for (int i = 1; i < argc - 1; ++i) { argv[i] = argv[i + 1]; }
131+
for (int i = 1; i < argc - 1; ++i) {
132+
argv[i] = argv[i + 1];
133+
}
132134
// Decrement the argument count to reflect the removal of our custom
133135
// argument.
134136
argc--;
@@ -140,7 +142,9 @@ int main(int argc, char** argv) {
140142

141143
// Check if any benchmarks are targeted to run. If not, we might want to
142144
// return.
143-
if (benchmark::ReportUnrecognizedArguments(argc, argv)) { return 1; };
145+
if (benchmark::ReportUnrecognizedArguments(argc, argv)) {
146+
return 1;
147+
};
144148

145149
benchmark::RunSpecifiedBenchmarks();
146150
benchmark::Shutdown();

cmake/Coverage.cmake

Lines changed: 0 additions & 41 deletions
This file was deleted.

cmake/Format.cmake

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)