[warnings] disable warnings for generated code

* Disable clang-tidy in test build directories
* Disable compiler warnings for test binary directories.

These contain generated code we can not change, so the warnings are just noise
This commit is contained in:
Armin Novak 2024-08-27 09:03:44 +02:00 committed by akallabeth
parent 6d994feef6
commit d71af44bb1
No known key found for this signature in database
GPG Key ID: A49454A3FC909FD5
40 changed files with 102 additions and 2 deletions

View File

@ -3,6 +3,8 @@ set(MODULE_PREFIX "TEST_SDL")
set(DRIVER ${MODULE_NAME}.cpp)
disable_warnings_for_directory(${CMAKE_CURRENT_BINARY_DIR})
set(TEST_SRCS
TestSDLDialogs.cpp
)

View File

@ -3,6 +3,9 @@ set(MODULE_PREFIX "TEST_SDL")
set(DRIVER ${MODULE_NAME}.cpp)
disable_warnings_for_directory(${CMAKE_CURRENT_BINARY_DIR})
set(TEST_SRCS
TestSDLDialogs.cpp
)

View File

@ -5,6 +5,9 @@ set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.cpp)
set(${MODULE_PREFIX}_TESTS TestSDLPrefs.cpp)
disable_warnings_for_directory(${CMAKE_CURRENT_BINARY_DIR})
create_test_sourcelist(${MODULE_PREFIX}_SRCS
${${MODULE_PREFIX}_DRIVER}
${${MODULE_PREFIX}_TESTS})

View File

@ -4,6 +4,8 @@ set(MODULE_PREFIX "TEST_CLIENT")
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
disable_warnings_for_directory(${CMAKE_CURRENT_BINARY_DIR})
set(${MODULE_PREFIX}_TESTS
TestClientRdpFile.c
TestClientChannels.c

View File

@ -35,3 +35,4 @@ include(MSVCRuntime)
include(ConfigureRPATH)
include(ClangTidy)
include(AddTargetWithResourceFile)
include(DisableCompilerWarnings)

View File

@ -0,0 +1,21 @@
if (MSVC)
set(COMPILE_WARN_OPTS "/W0")
else()
set(COMPILE_WARN_OPTS "-w")
endif()
set(COMPILE_WARN_OPTS "${COMPILE_WARN_OPTS}" CACHE STRING "cached value")
function (disable_warnings_for_directory dir)
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.19.0")
set_property(
DIRECTORY "${dir}"
PROPERTY COMPILE_OPTIONS ${COMPILE_WARN_OPTS}
)
endif()
file(MAKE_DIRECTORY "${dir}")
set(ctidy "${dir}/.clang-tidy")
file(WRITE ${ctidy} "Checks: '-*,misc-definitions-in-headers'\n")
file(APPEND ${ctidy} "CheckOptions:\n")
file(APPEND ${ctidy} "\t- { key: HeaderFileExtensions, value: \"x\" }\n")
endfunction()

View File

@ -2,6 +2,8 @@
set(MODULE_NAME "TestFreeRDPCodec")
set(MODULE_PREFIX "TEST_FREERDP_CODEC")
disable_warnings_for_directory(${CMAKE_CURRENT_BINARY_DIR})
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
set(${MODULE_PREFIX}_TESTS

View File

@ -2,6 +2,8 @@
set(MODULE_NAME "TestCommon")
set(MODULE_PREFIX "TEST_COMMON")
disable_warnings_for_directory(${CMAKE_CURRENT_BINARY_DIR})
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
set(${MODULE_PREFIX}_TESTS

View File

@ -2,6 +2,8 @@
set(MODULE_NAME "TestCore")
set(MODULE_PREFIX "TEST_CORE")
disable_warnings_for_directory(${CMAKE_CURRENT_BINARY_DIR})
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
set(${MODULE_PREFIX}_TESTS

View File

@ -2,6 +2,8 @@
set(MODULE_NAME "TestFreeRDPCrypto")
set(MODULE_PREFIX "TEST_FREERDP_CRYPTO")
disable_warnings_for_directory(${CMAKE_CURRENT_BINARY_DIR})
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
set(${MODULE_PREFIX}_TESTS

View File

@ -2,6 +2,8 @@
set(MODULE_NAME "TestGdi")
set(MODULE_PREFIX "TEST_GDI")
disable_warnings_for_directory(${CMAKE_CURRENT_BINARY_DIR})
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
set(${MODULE_PREFIX}_TESTS
@ -23,7 +25,7 @@ include_directories(..)
add_library(helpers STATIC
helpers.c)
target_link_libraries(helpers freerdp)
add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})

View File

@ -2,6 +2,8 @@
set(MODULE_NAME "TestPrimitives")
set(MODULE_PREFIX "TEST_FREERDP_PRIMITIVES")
disable_warnings_for_directory(${CMAKE_CURRENT_BINARY_DIR})
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
set(${MODULE_PREFIX}_TESTS

View File

@ -2,6 +2,8 @@
set(MODULE_NAME "TestFreeRDPUtils")
set(MODULE_PREFIX "TEST_FREERDP_UTILS")
disable_warnings_for_directory(${CMAKE_CURRENT_BINARY_DIR})
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
set(${MODULE_PREFIX}_TESTS

View File

@ -2,6 +2,8 @@
set(MODULE_NAME "TestRdTk")
set(MODULE_PREFIX "TEST_RDTK")
disable_warnings_for_directory(${CMAKE_CURRENT_BINARY_DIR})
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
set(${MODULE_PREFIX}_TESTS

View File

@ -2,6 +2,8 @@
set(MODULE_NAME "TestClipboard")
set(MODULE_PREFIX "TEST_CLIPBOARD")
disable_warnings_for_directory(${CMAKE_CURRENT_BINARY_DIR})
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
set(${MODULE_PREFIX}_TESTS

View File

@ -2,6 +2,8 @@
set(MODULE_NAME "TestComm")
set(MODULE_PREFIX "TEST_COMM")
disable_warnings_for_directory(${CMAKE_CURRENT_BINARY_DIR})
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
set(${MODULE_PREFIX}_TESTS

View File

@ -2,6 +2,8 @@
set(MODULE_NAME "TestCrt")
set(MODULE_PREFIX "TEST_CRT")
disable_warnings_for_directory(${CMAKE_CURRENT_BINARY_DIR})
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
set(${MODULE_PREFIX}_TESTS

View File

@ -2,6 +2,8 @@
set(MODULE_NAME "TestCrypto")
set(MODULE_PREFIX "TEST_CRYPTO")
disable_warnings_for_directory(${CMAKE_CURRENT_BINARY_DIR})
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
set(${MODULE_PREFIX}_TESTS

View File

@ -2,6 +2,8 @@
set(MODULE_NAME "TestDsParse")
set(MODULE_PREFIX "TEST_DSPARSE")
disable_warnings_for_directory(${CMAKE_CURRENT_BINARY_DIR})
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
set(${MODULE_PREFIX}_TESTS

View File

@ -2,6 +2,8 @@
set(MODULE_NAME "TestEnvironment")
set(MODULE_PREFIX "TEST_ENVIRONMENT")
disable_warnings_for_directory(${CMAKE_CURRENT_BINARY_DIR})
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
set(${MODULE_PREFIX}_TESTS

View File

@ -2,6 +2,8 @@
set(MODULE_NAME "TestError")
set(MODULE_PREFIX "TEST_ERROR")
disable_warnings_for_directory(${CMAKE_CURRENT_BINARY_DIR})
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
set(${MODULE_PREFIX}_TESTS

View File

@ -3,6 +3,8 @@ if (NOT WIN32)
set(MODULE_NAME "TestFile")
set(MODULE_PREFIX "TEST_FILE")
disable_warnings_for_directory(${CMAKE_CURRENT_BINARY_DIR})
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
set(${MODULE_PREFIX}_TESTS

View File

@ -2,6 +2,8 @@
set(MODULE_NAME "TestInterlocked")
set(MODULE_PREFIX "TEST_INTERLOCKED")
disable_warnings_for_directory(${CMAKE_CURRENT_BINARY_DIR})
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
set(${MODULE_PREFIX}_TESTS

View File

@ -2,6 +2,8 @@
set(MODULE_NAME "TestIo")
set(MODULE_PREFIX "TEST_IO")
disable_warnings_for_directory(${CMAKE_CURRENT_BINARY_DIR})
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
set(${MODULE_PREFIX}_TESTS

View File

@ -2,6 +2,8 @@
set(MODULE_NAME "TestLibrary")
set(MODULE_PREFIX "TEST_LIBRARY")
disable_warnings_for_directory(${CMAKE_CURRENT_BINARY_DIR})
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
set(${MODULE_PREFIX}_TESTS

View File

@ -2,6 +2,8 @@
set(MODULE_NAME "TestMemory")
set(MODULE_PREFIX "TEST_MEMORY")
disable_warnings_for_directory(${CMAKE_CURRENT_BINARY_DIR})
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
set(${MODULE_PREFIX}_TESTS

View File

@ -1,6 +1,8 @@
set(MODULE_NAME "TestNCrypt")
set(MODULE_PREFIX "TEST_NCRYPT")
disable_warnings_for_directory(${CMAKE_CURRENT_BINARY_DIR})
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
set(${MODULE_PREFIX}_TESTS
@ -22,7 +24,7 @@ foreach(test ${${MODULE_PREFIX}_TESTS})
endforeach()
target_link_libraries(${MODULE_NAME} winpr ${OPENSSL_LIBRARIES})
if(WIN32)
if(WIN32)
target_link_libraries(${MODULE_NAME} ncrypt)
endif()

View File

@ -2,6 +2,8 @@
set(MODULE_NAME "TestNt")
set(MODULE_PREFIX "TEST_NT")
disable_warnings_for_directory(${CMAKE_CURRENT_BINARY_DIR})
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
set(${MODULE_PREFIX}_TESTS

View File

@ -2,6 +2,8 @@
set(MODULE_NAME "TestPath")
set(MODULE_PREFIX "TEST_PATH")
disable_warnings_for_directory(${CMAKE_CURRENT_BINARY_DIR})
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
set(${MODULE_PREFIX}_TESTS

View File

@ -2,6 +2,8 @@
set(MODULE_NAME "TestPipe")
set(MODULE_PREFIX "TEST_PIPE")
disable_warnings_for_directory(${CMAKE_CURRENT_BINARY_DIR})
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
set(${MODULE_PREFIX}_TESTS

View File

@ -2,6 +2,8 @@
set(MODULE_NAME "TestPool")
set(MODULE_PREFIX "TEST_POOL")
disable_warnings_for_directory(${CMAKE_CURRENT_BINARY_DIR})
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
set(${MODULE_PREFIX}_TESTS

View File

@ -2,6 +2,8 @@
set(MODULE_NAME "TestSecurity")
set(MODULE_PREFIX "TEST_SECURITY")
disable_warnings_for_directory(${CMAKE_CURRENT_BINARY_DIR})
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
set(${MODULE_PREFIX}_TESTS

View File

@ -2,6 +2,8 @@
set(MODULE_NAME "TestSmartCard")
set(MODULE_PREFIX "TEST_SMARTCARD")
disable_warnings_for_directory(${CMAKE_CURRENT_BINARY_DIR})
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
set(${MODULE_PREFIX}_TESTS

View File

@ -2,6 +2,8 @@
set(MODULE_NAME "TestSspi")
set(MODULE_PREFIX "TEST_SSPI")
disable_warnings_for_directory(${CMAKE_CURRENT_BINARY_DIR})
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
set(${MODULE_PREFIX}_TESTS

View File

@ -2,6 +2,8 @@
set(MODULE_NAME "TestSynch")
set(MODULE_PREFIX "TEST_SYNCH")
disable_warnings_for_directory(${CMAKE_CURRENT_BINARY_DIR})
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
set(${MODULE_PREFIX}_TESTS

View File

@ -2,6 +2,8 @@
set(MODULE_NAME "TestSysInfo")
set(MODULE_PREFIX "TEST_SYSINFO")
disable_warnings_for_directory(${CMAKE_CURRENT_BINARY_DIR})
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
set(${MODULE_PREFIX}_TESTS

View File

@ -2,6 +2,8 @@
set(MODULE_NAME "TestThread")
set(MODULE_PREFIX "TEST_THREAD")
disable_warnings_for_directory(${CMAKE_CURRENT_BINARY_DIR})
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
set(${MODULE_PREFIX}_TESTS

View File

@ -2,6 +2,8 @@
set(MODULE_NAME "TestWinPRUtils")
set(MODULE_PREFIX "TEST_WINPR_UTILS")
disable_warnings_for_directory(${CMAKE_CURRENT_BINARY_DIR})
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
set(${MODULE_PREFIX}_TESTS

View File

@ -2,6 +2,8 @@
set(MODULE_NAME "TestWtsApi")
set(MODULE_PREFIX "TEST_WTSAPI")
disable_warnings_for_directory(${CMAKE_CURRENT_BINARY_DIR})
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
set(UNIX_ONLY

View File

@ -2,6 +2,8 @@
set(MODULE_NAME "TestWinPR")
set(MODULE_PREFIX "TEST_WINPR")
disable_warnings_for_directory(${CMAKE_CURRENT_BINARY_DIR})
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
set(${MODULE_PREFIX}_TESTS TestIntrinsics.c TestTypes.c)