File tree Expand file tree Collapse file tree 12 files changed +4
-36
lines changed
Expand file tree Collapse file tree 12 files changed +4
-36
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,8 @@ option(SONAME "Set the (SO)VERSION of the target"
5353option (DEPRECATE_HARD "Do not include deprecated functions in the library" OFF )
5454
5555# Compilation options
56+ set (CMAKE_C_STANDARD "90" CACHE STRING "The C standard to compile against" )
57+ option (CMAKE_C_EXTENSIONS "Whether compiler extensions are supported" OFF )
5658option (ENABLE_WERROR "Enable compilation with -Werror" OFF )
5759
5860if (UNIX )
@@ -91,7 +93,6 @@ endif()
9193# Modules
9294
9395include (FeatureSummary)
94- include (SetCStandard)
9596include (CheckLibraryExists)
9697include (CheckFunctionExists)
9798include (CheckSymbolExists)
Original file line number Diff line number Diff line change @@ -378,8 +378,8 @@ linker. These flags may be useful for cross-compilation or specialized
378378setups.
379379
380380- ` CMAKE_C_FLAGS ` : Set your own compiler flags
381- - ` C_STANDARD ` : the C standard to compile against; defaults to ` C90 `
382- - ` C_EXTENSIONS ` : whether compiler extensions are supported; defaults to ` OFF `
381+ - ` CMAKE_C_STANDARD ` : the C standard to compile against; defaults to ` C90 `
382+ - ` CMAKE_C_EXTENSIONS ` : whether compiler extensions are supported; defaults to ` OFF `
383383- ` CMAKE_FIND_ROOT_PATH ` : Override the search path for libraries
384384- ` ZLIB_LIBRARY ` , ` OPENSSL_SSL_LIBRARY ` AND ` OPENSSL_CRYPTO_LIBRARY ` :
385385Tell CMake where to find those specific libraries
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 3737endif ()
3838
3939add_library (ntlmclient OBJECT ${SRC_NTLMCLIENT} ${SRC_NTLMCLIENT_UNICODE} ${SRC_NTLMCLIENT_CRYPTO} )
40- set_target_properties (ntlmclient PROPERTIES C_STANDARD 90)
Original file line number Diff line number Diff line change 33file (GLOB SRC_EXAMPLES *.c *.h)
44
55add_executable (lg2 ${SRC_EXAMPLES} )
6- set_c_standard(lg2)
76
87# Ensure that we do not use deprecated functions internally
98add_definitions (-DGIT_DEPRECATE_HARD)
Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ foreach(fuzz_target_src ${SRC_FUZZERS})
2020 endif ()
2121
2222 add_executable (${fuzz_target_name} ${${fuzz_target_name} _SOURCES})
23- set_c_standard(${fuzz_target_name} )
2423 target_include_directories (${fuzz_target_name} PRIVATE ${LIBGIT2_INCLUDES} ${LIBGIT2_DEPENDENCY_INCLUDES} )
2524 target_include_directories (${fuzz_target_name} SYSTEM PRIVATE ${LIBGIT2_SYSTEM_INCLUDES} )
2625
Original file line number Diff line number Diff line change @@ -40,7 +40,6 @@ add_executable(git2_cli ${CLI_SRC_C} ${CLI_SRC_OS} ${CLI_OBJECTS}
4040 ${LIBGIT2_DEPENDENCY_OBJECTS} )
4141target_link_libraries (git2_cli ${CLI_LIBGIT2_LIBRARY} ${LIBGIT2_SYSTEM_LIBS} )
4242
43- set_c_standard(git2_cli)
4443set_target_properties (git2_cli PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${libgit2_BINARY_DIR} )
4544set_target_properties (git2_cli PROPERTIES OUTPUT_NAME ${LIBGIT2_FILENAME} )
4645
Original file line number Diff line number Diff line change 22# git library functionality.
33
44add_library (libgit2 OBJECT)
5- set_c_standard(libgit2)
65
76include (PkgBuildConfig)
87
Original file line number Diff line number Diff line change 11# util: a shared library for common utility functions for libgit2 projects
22
33add_library (util OBJECT)
4- set_c_standard(util)
54
65configure_file (git2_features.h.in git2_features.h)
76
Original file line number Diff line number Diff line change 33# even when they have aggressive C90 warnings enabled.
44
55add_executable (headertest headertest.c)
6- set_c_standard(headertest)
76
87target_include_directories (headertest PRIVATE ${LIBGIT2_INCLUDES} )
98
You can’t perform that action at this time.
0 commit comments