File tree Expand file tree Collapse file tree 14 files changed +11
-38
lines changed
Expand file tree Collapse file tree 14 files changed +11
-38
lines changed Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ jobs:
132132 env :
133133 CC : clang
134134 CFLAGS : -fsanitize=memory -fsanitize-memory-track-origins=2 -fsanitize-blacklist=/home/libgit2/source/script/sanitizers.supp -fno-optimize-sibling-calls -fno-omit-frame-pointer
135- CMAKE_OPTIONS : -DC_EXTENSIONS =ON -DCMAKE_PREFIX_PATH=/usr/local/msan -DUSE_HTTPS=mbedTLS -DUSE_SHA1=HTTPS -DREGEX_BACKEND=pcre -DDEPRECATE_HARD=ON -DUSE_BUNDLED_ZLIB=ON -DUSE_SSH=ON
135+ CMAKE_OPTIONS : -DCMAKE_C_EXTENSIONS =ON -DCMAKE_PREFIX_PATH=/usr/local/msan -DUSE_HTTPS=mbedTLS -DUSE_SHA1=HTTPS -DREGEX_BACKEND=pcre -DDEPRECATE_HARD=ON -DUSE_BUNDLED_ZLIB=ON -DUSE_SSH=ON
136136 CMAKE_GENERATOR : Ninja
137137 SKIP_SSH_TESTS : true
138138 SKIP_NEGOTIATE_TESTS : true
Original file line number Diff line number Diff line change @@ -53,6 +53,13 @@ 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+ # Default to c99 on Android Studio for compatibility; c90 everywhere else
57+ if ("${CMAKE_SYSTEM_NAME} " STREQUAL "Android" )
58+ set (CMAKE_C_STANDARD "99" CACHE STRING "The C standard to compile against" )
59+ else ()
60+ set (CMAKE_C_STANDARD "90" CACHE STRING "The C standard to compile against" )
61+ endif ()
62+ option (CMAKE_C_EXTENSIONS "Whether compiler extensions are supported" OFF )
5663option (ENABLE_WERROR "Enable compilation with -Werror" OFF )
5764
5865if (UNIX )
@@ -91,7 +98,6 @@ endif()
9198# Modules
9299
93100include (FeatureSummary)
94- include (SetCStandard)
95101include (CheckLibraryExists)
96102include (CheckFunctionExists)
97103include (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 @@ -93,7 +93,7 @@ void llhttp_free(llhttp_t* parser) {
9393 free (parser );
9494}
9595
96- #endif // defined(__wasm__)
96+ #endif /* defined(__wasm__) */
9797
9898/* Some getters required to get stuff from the parser */
9999
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
You can’t perform that action at this time.
0 commit comments