Skip to content

Commit

Permalink
fixed build directory in scan
Browse files Browse the repository at this point in the history
  • Loading branch information
cole-gannaway-sonarsource committed May 22, 2024
1 parent d87e909 commit 7f8b913
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/sonar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ jobs:
node-version: '18'
- name: Run build-wrapper
run: |
rm -rf build
mkdir build
cd build
cmake ..
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON .
cd ..
- name: Run sonar-scanner
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Expand Down
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
#
# ----------------------------------------------------------------------------
# Disable in-source builds to prevent source tree corruption.
# if(" ${CMAKE_SOURCE_DIR}" STREQUAL " ${CMAKE_BINARY_DIR}")
# message(FATAL_ERROR "
# FATAL: In-source builds are not allowed.
# You should create a separate directory for build files.
# ")
# endif()
if(" ${CMAKE_SOURCE_DIR}" STREQUAL " ${CMAKE_BINARY_DIR}")
message(FATAL_ERROR "
FATAL: In-source builds are not allowed.
You should create a separate directory for build files.
")
endif()

include(cmake/OpenCVMinDepVersions.cmake)

Expand Down
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
sonar.projectKey=SonarSource-Demos_opencv_552f564f-bcdb-47eb-abb2-4ba7feb428ee
sonar.cfamily.compile-commands=compile_commands.json
sonar.cfamily.compile-commands=build/compile_commands.json
sonar.exclusions=**/*.java

0 comments on commit 7f8b913

Please sign in to comment.