File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed
Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ ide_split_sources(libgit2_tests)
5151# this on newer compilers to avoid unnecessary recompilation.
5252#
5353if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0)
54- add_definitions ( -include \ "clar_suite.h\ ")
54+ target_compile_options (libgit2_tests PRIVATE -include "clar_suite.h" )
5555endif ()
5656
5757if (MSVC_IDE )
@@ -79,3 +79,15 @@ add_clar_test(ssh -v -sonline::push -sonline::clone::ssh_cert -s
7979add_clar_test(proxy -v -sonline::clone::proxy)
8080add_clar_test(auth_clone -v -sonline::clone::cred)
8181add_clar_test(auth_clone_and_push -v -sonline::clone::push -sonline::push)
82+
83+ # Header file validation project
84+ add_executable (headertest headertest.c)
85+ set_target_properties (headertest PROPERTIES C_STANDARD 90)
86+ set_target_properties (headertest PROPERTIES C_EXTENSIONS OFF )
87+ target_include_directories (headertest PRIVATE ${LIBGIT2_INCLUDES} )
88+
89+ if (MSVC )
90+ target_compile_options (headertest PUBLIC /W4 /WX)
91+ else ()
92+ target_compile_options (headertest PUBLIC -Wall -Wextra -pedantic -Werror)
93+ endif ()
Original file line number Diff line number Diff line change 1+ /*
2+ * Dummy project to validate header files
3+ *
4+ * This project is not intended to be executed, it should only include all
5+ * header files to make sure that they can be used with stricter compiler
6+ * settings than the libgit2 source files generally supports.
7+ */
8+ #include "git2.h"
9+
10+ int main (void )
11+ {
12+ return 0 ;
13+ }
You can’t perform that action at this time.
0 commit comments