mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-06-30 23:05:57 +00:00
Enable GCC static analysis in CI
This commit is contained in:
parent
515bea6fb4
commit
7f665babf9
@ -5,6 +5,7 @@ project(moonlight-common-c LANGUAGES C)
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||
|
||||
option(USE_MBEDTLS "Use MbedTLS instead of OpenSSL" OFF)
|
||||
option(CODE_ANALYSIS "Run code analysis during compilation" OFF)
|
||||
|
||||
SET(CMAKE_C_STANDARD 11)
|
||||
|
||||
@ -39,6 +40,9 @@ elseif(MINGW)
|
||||
target_link_libraries(moonlight-common-c PRIVATE -lws2_32 -lwinmm)
|
||||
else()
|
||||
target_compile_options(moonlight-common-c PRIVATE -Wall -Wextra -Wno-unused-parameter -Werror)
|
||||
if (CODE_ANALYSIS AND CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
target_compile_options(moonlight-common-c PRIVATE -fanalyzer)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (USE_MBEDTLS)
|
||||
|
@ -15,6 +15,7 @@ environment:
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
|
||||
CC: gcc
|
||||
CXX: g++
|
||||
CMAKE_ARGS: -DCODE_ANALYSIS=ON
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
@ -23,7 +24,7 @@ environment:
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
|
||||
CC: gcc
|
||||
CXX: g++
|
||||
CMAKE_ARGS: -DUSE_MBEDTLS=ON
|
||||
CMAKE_ARGS: -DUSE_MBEDTLS=ON -DCODE_ANALYSIS=ON
|
||||
PREBUILD_CMD: sudo apt install -y libmbedtls-dev
|
||||
|
||||
before_build:
|
||||
|
Loading…
x
Reference in New Issue
Block a user