Skip to content

Commit ed2748c

Browse files
committed
optionally precompile headers
1 parent 0531f7c commit ed2748c

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

CMakeLists.txt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,13 @@ target_link_libraries(c++spec INTERFACE
3535
)
3636

3737
FILE(GLOB_RECURSE c++spec_headers ${CMAKE_CURRENT_LIST_DIR}/include/*.hpp)
38-
target_precompile_headers(c++spec INTERFACE
39-
${c++spec_headers}
40-
)
38+
39+
option(CPPSPEC_PRECOMPILE_HEADERS "Precompile the C++Spec headers")
40+
if(CPPSPEC_PRECOMPILE_HEADERS)
41+
target_precompile_headers(c++spec INTERFACE
42+
${c++spec_headers}
43+
)
44+
endif()
4145

4246
# HELPERS
4347

@@ -79,7 +83,7 @@ if(CPPSPEC_BUILD_EXAMPLES)
7983
add_subdirectory(examples)
8084
endif(CPPSPEC_BUILD_EXAMPLES)
8185

82-
##### Documentation generation #######
86+
# #### Documentation generation #######
8387
if(CPPSPEC_BUILD_DOCS)
8488
find_package(Doxygen
8589
OPTIONAL_COMPONENTS dot mscgen dia

include/argparse.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ struct RuntimeOpts {
2626
std::shared_ptr<Formatters::BaseFormatter> formatter = nullptr;
2727
};
2828

29-
inline Runner parse(int argc, char** argv) {
29+
inline Runner parse(int argc, char** const argv) {
3030
argparse::ArgumentParser program{file_name(argv[0])};
3131

3232
program.add_argument("-f", "--format")
@@ -64,4 +64,4 @@ inline Runner parse(int argc, char** argv) {
6464

6565
return Runner{opts.formatter};
6666
}
67-
} // namespace CppSpec
67+
} // namespace CppSpec

include/cppspec.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,16 @@
3737
#define before_each self.before_each
3838
#define after_all self.after_all
3939
#define after_each self.after_each
40-
#define let(name, body) auto (name) = self.let(body);
40+
#define let(name, body) auto(name) = self.let(body);
4141

4242
#define CPPSPEC_MAIN(spec) \
43-
int main(int argc, char **argv) { \
43+
int main(int argc, char **const argv) { \
4444
return CppSpec::parse(argc, argv).add_spec(spec).exec() ? EXIT_SUCCESS \
4545
: EXIT_FAILURE; \
4646
}
4747

4848
#define CPPSPEC_SPEC(spec_name) \
49-
int spec_name_spec(int argc, char **argv) { \
49+
int spec_name_spec(int argc, char **const argv) { \
5050
return CppSpec::parse(argc, argv).add_spec(spec_name).exec() \
5151
? EXIT_SUCCESS \
5252
: EXIT_FAILURE; \

0 commit comments

Comments
 (0)