Skip to content

Commit

Permalink
Enable GCC static analysis in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
cgutman committed Sep 16, 2023
1 parent 515bea6 commit 7f665ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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++
Expand All @@ -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:
Expand Down

0 comments on commit 7f665ba

Please sign in to comment.