cmake: fix cmakelint warnings
- keep line lengths below 132 characters. - fix two "weird indentation" warnings. Reported-by: Dan Fandrich Bug: #14580 Closes #14583
This commit is contained in:
parent
3e60f174ee
commit
dcf5a5383c
@ -286,7 +286,8 @@ if(GSS_FLAVOUR)
|
|||||||
set(GSS_VERSION "Heimdal Unknown")
|
set(GSS_VERSION "Heimdal Unknown")
|
||||||
endif()
|
endif()
|
||||||
elseif(NOT GSS_VERSION AND GSS_FLAVOUR STREQUAL "MIT")
|
elseif(NOT GSS_VERSION AND GSS_FLAVOUR STREQUAL "MIT")
|
||||||
get_filename_component(_mit_version "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MIT\\Kerberos\\SDK\\CurrentVersion;VersionString]" NAME CACHE)
|
get_filename_component(_mit_version "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MIT\\Kerberos\\SDK\\CurrentVersion;VersionString]" NAME
|
||||||
|
CACHE)
|
||||||
if(WIN32 AND _mit_version)
|
if(WIN32 AND _mit_version)
|
||||||
set(GSS_VERSION "${_mit_version}")
|
set(GSS_VERSION "${_mit_version}")
|
||||||
else()
|
else()
|
||||||
@ -306,4 +307,14 @@ find_package_handle_standard_args(GSS
|
|||||||
"Could NOT find GSS, try to set the path to GSS root folder in the system variable GSS_ROOT_DIR"
|
"Could NOT find GSS, try to set the path to GSS root folder in the system variable GSS_ROOT_DIR"
|
||||||
)
|
)
|
||||||
|
|
||||||
mark_as_advanced(_GSS_CFLAGS _GSS_FOUND _GSS_INCLUDE_DIRS _GSS_LDFLAGS _GSS_LIBRARIES _GSS_LIBRARY_DIRS _GSS_MODULE_NAME _GSS_PREFIX _GSS_VERSION)
|
mark_as_advanced(
|
||||||
|
_GSS_CFLAGS
|
||||||
|
_GSS_FOUND
|
||||||
|
_GSS_INCLUDE_DIRS
|
||||||
|
_GSS_LDFLAGS
|
||||||
|
_GSS_LIBRARIES
|
||||||
|
_GSS_LIBRARY_DIRS
|
||||||
|
_GSS_MODULE_NAME
|
||||||
|
_GSS_PREFIX
|
||||||
|
_GSS_VERSION
|
||||||
|
)
|
||||||
|
|||||||
@ -28,7 +28,7 @@ unset(WPICKY)
|
|||||||
if(CURL_WERROR AND
|
if(CURL_WERROR AND
|
||||||
((CMAKE_COMPILER_IS_GNUCC AND
|
((CMAKE_COMPILER_IS_GNUCC AND
|
||||||
NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0 AND
|
NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0 AND
|
||||||
NOT CMAKE_VERSION VERSION_LESS 3.23.0) OR # check_symbol_exists() incompatible with GCC -pedantic-errors in earlier CMake versions
|
NOT CMAKE_VERSION VERSION_LESS 3.23.0) OR # to avoid check_symbol_exists() conflicting with GCC -pedantic-errors
|
||||||
CMAKE_C_COMPILER_ID MATCHES "Clang"))
|
CMAKE_C_COMPILER_ID MATCHES "Clang"))
|
||||||
set(WPICKY "${WPICKY} -pedantic-errors")
|
set(WPICKY "${WPICKY} -pedantic-errors")
|
||||||
endif()
|
endif()
|
||||||
@ -104,13 +104,13 @@ if(PICKY_COMPILER)
|
|||||||
-Wmissing-noreturn # clang 2.7 gcc 4.1
|
-Wmissing-noreturn # clang 2.7 gcc 4.1
|
||||||
-Wno-format-nonliteral # clang 1.0 gcc 2.96 (3.0)
|
-Wno-format-nonliteral # clang 1.0 gcc 2.96 (3.0)
|
||||||
-Wno-system-headers # clang 1.0 gcc 3.0
|
-Wno-system-headers # clang 1.0 gcc 3.0
|
||||||
# -Wpadded # clang 2.9 gcc 4.1 # Not used because we cannot change public structs
|
# -Wpadded # clang 2.9 gcc 4.1 # Not used: We cannot change public structs
|
||||||
-Wold-style-definition # clang 2.7 gcc 3.4
|
-Wold-style-definition # clang 2.7 gcc 3.4
|
||||||
-Wredundant-decls # clang 2.7 gcc 4.1
|
-Wredundant-decls # clang 2.7 gcc 4.1
|
||||||
-Wsign-conversion # clang 2.9 gcc 4.3
|
-Wsign-conversion # clang 2.9 gcc 4.3
|
||||||
-Wno-error=sign-conversion # FIXME
|
-Wno-error=sign-conversion # FIXME
|
||||||
-Wstrict-prototypes # clang 1.0 gcc 3.3
|
-Wstrict-prototypes # clang 1.0 gcc 3.3
|
||||||
# -Wswitch-enum # clang 2.7 gcc 4.1 # Not used because this basically disallows default case
|
# -Wswitch-enum # clang 2.7 gcc 4.1 # Not used: It basically disallows default case
|
||||||
-Wtype-limits # clang 2.7 gcc 4.3
|
-Wtype-limits # clang 2.7 gcc 4.3
|
||||||
-Wunreachable-code # clang 2.7 gcc 4.1
|
-Wunreachable-code # clang 2.7 gcc 4.1
|
||||||
# -Wunused-macros # clang 2.7 gcc 4.1 # Not practical
|
# -Wunused-macros # clang 2.7 gcc 4.1 # Not practical
|
||||||
@ -160,7 +160,7 @@ if(PICKY_COMPILER)
|
|||||||
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 10.0) OR
|
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 10.0) OR
|
||||||
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 12.4))
|
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 12.4))
|
||||||
list(APPEND WPICKY_ENABLE
|
list(APPEND WPICKY_ENABLE
|
||||||
-Wimplicit-fallthrough # clang 4.0 gcc 7.0 appleclang 12.4 # we have silencing markup for clang 10.0 and above only
|
-Wimplicit-fallthrough # clang 4.0 gcc 7.0 appleclang 12.4 # We do silencing for clang 10.0 and above only
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
else() # gcc
|
else() # gcc
|
||||||
|
|||||||
@ -165,7 +165,7 @@ option(ENABLE_DEBUG "Set to ON to enable curl debug features" OFF)
|
|||||||
option(ENABLE_CURLDEBUG "Set to ON to build with TrackMemory feature enabled" ${ENABLE_DEBUG})
|
option(ENABLE_CURLDEBUG "Set to ON to build with TrackMemory feature enabled" ${ENABLE_DEBUG})
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
set(ENABLE_CURLDEBUG OFF) # FIXME: TrackMemory fails with MSVC according to test 558 and 1330. Tested with static build, Debug mode.
|
set(ENABLE_CURLDEBUG OFF) # FIXME: TrackMemory + MSVC fails test 558 and 1330. Tested with static build, Debug mode.
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_DEBUG)
|
if(ENABLE_DEBUG)
|
||||||
@ -734,7 +734,8 @@ macro(openssl_check_quic)
|
|||||||
if(USE_OPENSSL)
|
if(USE_OPENSSL)
|
||||||
openssl_check_symbol_exists("SSL_CTX_set_quic_method" "openssl/ssl.h" HAVE_SSL_CTX_SET_QUIC_METHOD "")
|
openssl_check_symbol_exists("SSL_CTX_set_quic_method" "openssl/ssl.h" HAVE_SSL_CTX_SET_QUIC_METHOD "")
|
||||||
elseif(USE_WOLFSSL)
|
elseif(USE_WOLFSSL)
|
||||||
openssl_check_symbol_exists("wolfSSL_set_quic_method" "wolfssl/options.h;wolfssl/openssl/ssl.h" HAVE_SSL_CTX_SET_QUIC_METHOD "")
|
openssl_check_symbol_exists("wolfSSL_set_quic_method" "wolfssl/options.h;wolfssl/openssl/ssl.h"
|
||||||
|
HAVE_SSL_CTX_SET_QUIC_METHOD "")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
if(NOT HAVE_SSL_CTX_SET_QUIC_METHOD)
|
if(NOT HAVE_SSL_CTX_SET_QUIC_METHOD)
|
||||||
@ -1743,8 +1744,11 @@ function(transform_makefile_inc _input_file _output_file)
|
|||||||
string(REGEX REPLACE "([a-zA-Z_][a-zA-Z0-9_]*)[\t ]*=[\t ]*([^\n]*)" "SET(\\1 \\2)" _makefile_inc_text ${_makefile_inc_text})
|
string(REGEX REPLACE "([a-zA-Z_][a-zA-Z0-9_]*)[\t ]*=[\t ]*([^\n]*)" "SET(\\1 \\2)" _makefile_inc_text ${_makefile_inc_text})
|
||||||
string(REPLACE "!π!α!" "\n" _makefile_inc_text ${_makefile_inc_text})
|
string(REPLACE "!π!α!" "\n" _makefile_inc_text ${_makefile_inc_text})
|
||||||
|
|
||||||
string(REGEX REPLACE "\\$\\(([a-zA-Z_][a-zA-Z0-9_]*)\\)" "\${\\1}" _makefile_inc_text ${_makefile_inc_text}) # Replace $() with ${}
|
# Replace $() with ${}
|
||||||
string(REGEX REPLACE "@([a-zA-Z_][a-zA-Z0-9_]*)@" "\${\\1}" _makefile_inc_text ${_makefile_inc_text}) # Replace @@ with ${}, even if that may not be read by CMake scripts.
|
string(REGEX REPLACE "\\$\\(([a-zA-Z_][a-zA-Z0-9_]*)\\)" "\${\\1}" _makefile_inc_text ${_makefile_inc_text})
|
||||||
|
# Replace @@ with ${}, even if that may not be read by CMake scripts.
|
||||||
|
string(REGEX REPLACE "@([a-zA-Z_][a-zA-Z0-9_]*)@" "\${\\1}" _makefile_inc_text ${_makefile_inc_text})
|
||||||
|
|
||||||
file(WRITE ${_output_file} ${_makefile_inc_text})
|
file(WRITE ${_output_file} ${_makefile_inc_text})
|
||||||
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${_input_file}")
|
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${_input_file}")
|
||||||
endfunction()
|
endfunction()
|
||||||
@ -2051,8 +2055,9 @@ if(NOT CURL_DISABLE_INSTALL)
|
|||||||
# SUPPORT_FEATURES
|
# SUPPORT_FEATURES
|
||||||
# SUPPORT_PROTOCOLS
|
# SUPPORT_PROTOCOLS
|
||||||
# VERSIONNUM
|
# VERSIONNUM
|
||||||
configure_file("${CURL_SOURCE_DIR}/curl-config.in"
|
configure_file(
|
||||||
"${CURL_BINARY_DIR}/curl-config" @ONLY)
|
"${CURL_SOURCE_DIR}/curl-config.in"
|
||||||
|
"${CURL_BINARY_DIR}/curl-config" @ONLY)
|
||||||
install(FILES "${CURL_BINARY_DIR}/curl-config"
|
install(FILES "${CURL_BINARY_DIR}/curl-config"
|
||||||
DESTINATION ${CMAKE_INSTALL_BINDIR}
|
DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
PERMISSIONS
|
PERMISSIONS
|
||||||
@ -2075,8 +2080,9 @@ if(NOT CURL_DISABLE_INSTALL)
|
|||||||
# prefix
|
# prefix
|
||||||
# SUPPORT_FEATURES
|
# SUPPORT_FEATURES
|
||||||
# SUPPORT_PROTOCOLS
|
# SUPPORT_PROTOCOLS
|
||||||
configure_file("${CURL_SOURCE_DIR}/libcurl.pc.in"
|
configure_file(
|
||||||
"${CURL_BINARY_DIR}/libcurl.pc" @ONLY)
|
"${CURL_SOURCE_DIR}/libcurl.pc.in"
|
||||||
|
"${CURL_BINARY_DIR}/libcurl.pc" @ONLY)
|
||||||
install(FILES "${CURL_BINARY_DIR}/libcurl.pc"
|
install(FILES "${CURL_BINARY_DIR}/libcurl.pc"
|
||||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
|
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
|
||||||
|
|
||||||
|
|||||||
@ -30,10 +30,12 @@ if(ENABLE_CURL_MANUAL AND HAVE_MANUAL_TOOLS)
|
|||||||
OUTPUT "tool_hugehelp.c"
|
OUTPUT "tool_hugehelp.c"
|
||||||
COMMAND ${CMAKE_COMMAND} -E echo "#include \"tool_setup.h\"" > "tool_hugehelp.c"
|
COMMAND ${CMAKE_COMMAND} -E echo "#include \"tool_setup.h\"" > "tool_hugehelp.c"
|
||||||
COMMAND ${CMAKE_COMMAND} -E echo "#ifndef HAVE_LIBZ" >> "tool_hugehelp.c"
|
COMMAND ${CMAKE_COMMAND} -E echo "#ifndef HAVE_LIBZ" >> "tool_hugehelp.c"
|
||||||
COMMAND "${PERL_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/mkhelp.pl" < "${CURL_BINARY_DIR}/docs/cmdline-opts/curl.txt" >> "tool_hugehelp.c"
|
COMMAND "${PERL_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/mkhelp.pl"
|
||||||
|
< "${CURL_BINARY_DIR}/docs/cmdline-opts/curl.txt" >> "tool_hugehelp.c"
|
||||||
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E echo "#else" >> "tool_hugehelp.c"
|
COMMAND ${CMAKE_COMMAND} -E echo "#else" >> "tool_hugehelp.c"
|
||||||
COMMAND "${PERL_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/mkhelp.pl" -c < "${CURL_BINARY_DIR}/docs/cmdline-opts/curl.txt" >> "tool_hugehelp.c"
|
COMMAND "${PERL_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/mkhelp.pl" -c
|
||||||
|
< "${CURL_BINARY_DIR}/docs/cmdline-opts/curl.txt" >> "tool_hugehelp.c"
|
||||||
COMMAND ${CMAKE_COMMAND} -E echo "#endif /* HAVE_LIBZ */" >> "tool_hugehelp.c"
|
COMMAND ${CMAKE_COMMAND} -E echo "#endif /* HAVE_LIBZ */" >> "tool_hugehelp.c"
|
||||||
DEPENDS
|
DEPENDS
|
||||||
"generate-curl.1"
|
"generate-curl.1"
|
||||||
@ -59,7 +61,8 @@ if(CURL_CA_EMBED_SET)
|
|||||||
add_definitions("-DCURL_CA_EMBED")
|
add_definitions("-DCURL_CA_EMBED")
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT "tool_ca_embed.c"
|
OUTPUT "tool_ca_embed.c"
|
||||||
COMMAND "${PERL_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/mk-file-embed.pl" --var curl_ca_embed < "${CURL_CA_EMBED}" > "tool_ca_embed.c"
|
COMMAND "${PERL_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/mk-file-embed.pl" --var curl_ca_embed
|
||||||
|
< "${CURL_CA_EMBED}" > "tool_ca_embed.c"
|
||||||
DEPENDS
|
DEPENDS
|
||||||
"${CURL_CA_EMBED}"
|
"${CURL_CA_EMBED}"
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/mk-file-embed.pl"
|
"${CMAKE_CURRENT_SOURCE_DIR}/mk-file-embed.pl"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user