Skip to content

Commit bd8b362

Browse files
committed
Switch to fetchcontent instead of submodules
1 parent 4790fe5 commit bd8b362

File tree

8 files changed

+114
-12
lines changed

8 files changed

+114
-12
lines changed

.clang-tidy

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
Checks: >
3+
-*,
4+
readability-braces-around-statements,
5+
clang-diagnostic-*,
6+
clang-analyzer-*,
7+
cppcoreguidelines-*,
8+
cppcoreguidelines-*,
9+
readability-*,
10+
modernize-*,
11+
bugprone-*,
12+
chromium-include-order,
13+
performance-for-range-copy,
14+
performance-implicit-conversion-in-loop,
15+
performance-inefficient-algorithm,
16+
performance-inefficient-string-concatenation,
17+
performance-inefficient-vector-operation,
18+
performance-move-const-arg,
19+
performance-move-constructor-init,
20+
performance-no-automatic-move,
21+
performance-no-int-to-ptr,
22+
performance-trivially-destructible,
23+
performance-type-promotion-in-math-fn,
24+
performance-unnecessary-copy-initialization,
25+
performance-unnecessary-value-param,
26+
-modernize-use-trailing-return-type,
27+
-modernize-avoid-c-arrays,
28+
-bugprone-easily-swappable-parameters,
29+
-cppcoreguidelines-avoid-non-const-global-variables,
30+
-cppcoreguidelines-avoid-magic-numbers,
31+
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
32+
-cppcoreguidelines-special-member-functions,
33+
-cppcoreguidelines-pro-bounds-constant-array-index,
34+
-cppcoreguidelines-non-private-member-variables-in-classes,
35+
-readability-uppercase-literal-suffix,
36+
-readability-identifier-length,
37+
-readability-magic-numbers
38+
WarningsAsErrors: false # should be true once we get there
39+
#HeaderFileExtensions: ['h','hh','hpp','hxx'] # enable iff clang-tidy v17+
40+
#ImplementationFileExtensions: ['c','cc','cpp','cxx'] # enable iff clang-tidy v17+ (stops from touching .S assembly files)
41+
HeaderFilterRegex: ".*"
42+
AnalyzeTemporaryDtors: false
43+
ExtraArgs: ['-Wno-unknown-argument', '-Wno-unknown-warning-option', '-W']
44+
FormatStyle: file
45+
CheckOptions:
46+
- key: cppcoreguidelines-explicit-virtual-functions.IgnoreDestructors
47+
value: "1"
48+
- key: cppcoreguidelines-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
49+
value: "1"
50+
- key: modernize-loop-convert.IncludeStyle
51+
value: google
52+
- key: modernize-pass-by-value.IncludeStyle
53+
value: google
54+
- key: modernize-replace-auto-ptr.IncludeStyle
55+
value: google

.gitmodules

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

.vscode/extensions.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"recommendations": [
3+
"llvm-vs-code-extensions.vscode-clangd"
4+
]
5+
}

.vscode/settings.json

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,30 @@
7474
"xmemory": "cpp",
7575
"xstring": "cpp",
7676
"xtree": "cpp"
77-
}
77+
},
78+
"C_Cpp.intelliSenseEngine": "disabled",
79+
"C_Cpp.autocomplete": "disabled",
80+
"C_Cpp.errorSquiggles": "disabled",
81+
"editor.tokenColorCustomizations": {
82+
"textMateRules": [
83+
{
84+
"scope": "googletest.failed",
85+
"settings": {
86+
"foreground": "#f00"
87+
}
88+
},
89+
{
90+
"scope": "googletest.passed",
91+
"settings": {
92+
"foreground": "#0f0"
93+
}
94+
},
95+
{
96+
"scope": "googletest.run",
97+
"settings": {
98+
"foreground": "#0f0"
99+
}
100+
}
101+
]
102+
},
78103
}

CMakeLists.txt

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,36 @@ project(c++spec)
77

88
set(CMAKE_COLOR_DIAGNOSTICS ON)
99

10+
cmake_policy(SET CMP0135 NEW)
11+
12+
include(FetchContent)
13+
14+
# FetchContent_Declare(argparse
15+
# GIT_REPOSITORY https://github.com/p-ranav/argparse/
16+
# GIT_TAG v2.9
17+
# )
18+
# FetchContent_MakeAvailable(argparse)
19+
20+
FetchContent_Declare(cxx-prettyprint
21+
GIT_REPOSITORY https://github.com/louisdx/cxx-prettyprint
22+
GIT_TAG master
23+
)
24+
FetchContent_MakeAvailable(cxx-prettyprint)
25+
26+
add_library(cxx-prettyprint INTERFACE)
27+
target_sources(cxx-prettyprint INTERFACE ${cxx-prettyprint_SOURCE_DIR}/prettyprint.hpp)
28+
target_include_directories(cxx-prettyprint INTERFACE ${cxx-prettyprint_SOURCE_DIR})
29+
30+
1031
add_library(c++spec INTERFACE)
1132
target_include_directories(c++spec INTERFACE
1233
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/>
1334
$<INSTALL_INTERFACE:include/cppspec/> # <prefix>/include/cppspec
1435
)
36+
target_link_libraries(c++spec INTERFACE
37+
cxx-prettyprint
38+
# argparse
39+
)
1540

1641
FILE(GLOB_RECURSE c++spec_headers ${CMAKE_CURRENT_LIST_DIR}/include/*.hpp)
1742
target_precompile_headers(c++spec INTERFACE
@@ -50,10 +75,6 @@ if(DOXYGEN_FOUND)
5075
"Can't find GraphViz DOT tool for generating images."
5176
"Make sure it's on your PATH or install GraphViz")
5277
endif()
53-
54-
cmake_policy(SET CMP0135 NEW)
55-
56-
include(FetchContent)
5778

5879
FetchContent_Declare(doxygen-awesome-css
5980
URL https://github.com/jothepro/doxygen-awesome-css/archive/refs/tags/v2.2.1.tar.gz
@@ -65,7 +86,7 @@ if(DOXYGEN_FOUND)
6586
set(DOXYGEN_PROJECT_BRIEF "BDD testing for C++")
6687
set(DOXYGEN_RECURSIVE YES)
6788
set(DOXYGEN_EXAMPLE_RECURSIVE YES)
68-
89+
set(DOXYGEN_EXCLUDE_PATTERNS "*/cxx-prettyprint/*")
6990
set(DOXYGEN_NUM_PROC_THREADS ${HOST_NUM_CORES})
7091

7192
# From doxygen-awesome

include/cxx-prettyprint

Lines changed: 0 additions & 1 deletion
This file was deleted.

include/matchers/pretty_matchers.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <vector>
88
#include <algorithm>
99
#include <regex>
10-
#include "cxx-prettyprint/prettyprint.hpp"
10+
#include "prettyprint.hpp"
1111
#include "util.hpp"
1212

1313
namespace CppSpec {

include/runner.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Runner {
1818
Formatters::BaseFormatter &formatter;
1919

2020
public:
21-
typedef std::function<void(Runner &)> spec_group;
21+
using spec_group = std::function<void (Runner &)>;
2222
explicit Runner(Formatters::BaseFormatter &formatter =
2323
Formatters::progress) noexcept : formatter(formatter) {}
2424

0 commit comments

Comments
 (0)