Add a minimal binary to generate compile_commands.json file

clang-tidy needs compile_commands.json to generate a set of source files
to parse.  tidy-base is not built but is used as a source file in which
included headers can be parsed.  Without this process, clang-tidy will
process many other source files (e.g. doctest.hpp) that we do not want
to worry about.

Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
This commit is contained in:
Sean Robinson 2021-11-10 13:54:25 -07:00
parent 4cacdc4b30
commit 18a229e849
2 changed files with 11 additions and 0 deletions

View File

@ -57,3 +57,10 @@ set_property(TARGET ARGPARSE PROPERTY CXX_STANDARD 17)
# Set ${PROJECT_NAME} as the startup project # Set ${PROJECT_NAME} as the startup project
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT ARGPARSE) set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT ARGPARSE)
file(GLOB ARGPARSE_LINT_SOURCES
tidy-base.cpp
)
ADD_EXECUTABLE(ARGPARSE_LINT ${ARGPARSE_LINT_SOURCES})
set_target_properties(ARGPARSE_LINT PROPERTIES OUTPUT_NAME tidy-base)
set_property(TARGET ARGPARSE_LINT PROPERTY CXX_STANDARD 17)

4
test/tidy-base.cpp Normal file
View File

@ -0,0 +1,4 @@
#include "argparse/argparse.hpp"
int main(int argc, const char* argv[]) {}