[ci,coverity] define COVERITY_BUILD

By defining this symbol the build will enable coverity related pragma
definitions
This commit is contained in:
akallabeth 2024-11-14 13:33:14 +01:00
parent 8883ccc503
commit 9b3f5cd86e
No known key found for this signature in database
GPG Key ID: A49454A3FC909FD5
4 changed files with 13 additions and 1 deletions

View File

@ -79,6 +79,7 @@ jobs:
-GNinja \ -GNinja \
-C ci/cmake-preloads/config-coverity.txt \ -C ci/cmake-preloads/config-coverity.txt \
-DALLOW_IN_SOURCE_BUILD=true \ -DALLOW_IN_SOURCE_BUILD=true \
-DCOVERITY_BUILD=ON \
-B. \ -B. \
-S. -S.
cov-build --dir cov-int cmake --build . cov-build --dir cov-int cmake --build .

View File

@ -56,6 +56,11 @@ if (NOT WIN32 AND NOT ANDROID)
option(WITH_X11 "build X11 client/server" ${OPT_DEFAULT_VAL}) option(WITH_X11 "build X11 client/server" ${OPT_DEFAULT_VAL})
endif() endif()
# Enable coverity related pragma definitions
if (COVERITY_BUILD)
add_compile_definitions(COVERITY_BUILD)
endif()
# Include our extra modules # Include our extra modules
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/) list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/)

View File

@ -33,6 +33,11 @@ if (NOT FREERDP_UNIFIED_BUILD)
include(CommonConfigOptions) include(CommonConfigOptions)
include(ConfigOptions) include(ConfigOptions)
# Enable coverity related pragma definitions
if (COVERITY_BUILD)
add_compile_definitions(COVERITY_BUILD)
endif()
# Default to build shared libs # Default to build shared libs
option(EXPORT_ALL_SYMBOLS "Export all symbols form library" OFF) option(EXPORT_ALL_SYMBOLS "Export all symbols form library" OFF)

View File

@ -32,7 +32,8 @@
#define WINPR_DO_PRAGMA(x) __pragma(#x) #define WINPR_DO_PRAGMA(x) __pragma(#x)
#endif #endif
#if !defined(__COVERITY__) /* COVERITY_BUILD must be defined by build system */
#if !defined(COVERITY_BUILD)
#define WINPR_DO_COVERITY_PRAGMA(x) #define WINPR_DO_COVERITY_PRAGMA(x)
#else #else
#define WINPR_DO_COVERITY_PRAGMA(x) WINPR_DO_PRAGMA(x) #define WINPR_DO_COVERITY_PRAGMA(x) WINPR_DO_PRAGMA(x)