Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pugs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
code
pugs
Commits
b70e2cd8
Commit
b70e2cd8
authored
Apr 23, 2020
by
Stéphane Del Pino
Browse files
Options
Downloads
Patches
Plain Diff
Improve clazy-standalone integration
Supports '-k' option for GNU Make generator
parent
d5a32212
No related branches found
No related tags found
1 merge request
!35
Feature/clazy
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+3
-2
3 additions, 2 deletions
CMakeLists.txt
cmake/ClazyStandaloneProcess.cmake
+23
-5
23 additions, 5 deletions
cmake/ClazyStandaloneProcess.cmake
with
26 additions
and
7 deletions
CMakeLists.txt
+
3
−
2
View file @
b70e2cd8
...
...
@@ -210,6 +210,7 @@ endif()
add_subdirectory
(
"
${
PUGS_SOURCE_DIR
}
/packages/kokkos"
)
# set as SYSTEM for static analysis
include_directories
(
SYSTEM
${
KOKKOS_SOURCE_DIR
}
/core/src
)
include_directories
(
SYSTEM
${
KOKKOS_SOURCE_DIR
}
/containers/src
)
include_directories
(
SYSTEM
${
KOKKOS_BINARY_DIR
}
)
...
...
@@ -268,8 +269,8 @@ endif()
# Rang (colors? Useless thus necessary!)
include_directories
(
${
PUGS_SOURCE_DIR
}
/packages/rang/include
)
# CLI11
include_directories
(
${
PUGS_SOURCE_DIR
}
/packages/CLI11/include
)
# CLI11
(set as SYSTEM for static analysis)
include_directories
(
SYSTEM
${
PUGS_SOURCE_DIR
}
/packages/CLI11/include
)
# PEGTL
include_directories
(
${
PUGS_SOURCE_DIR
}
/packages/PEGTL/include/tao
)
...
...
This diff is collapsed.
Click to expand it.
cmake/ClazyStandaloneProcess.cmake
+
23
−
5
View file @
b70e2cd8
...
...
@@ -20,22 +20,40 @@ if(PUGS_SOURCE_DIR AND CLAZY_STANDALONE)
endif
()
endif
()
list
(
LENGTH ALL_SOURCE_FILES LIST_SIZE
)
set
(
SOURCE_ID 1
)
# apply style to the file list
foreach
(
SOURCE_FILE
${
ALL_SOURCE_FILES
}
)
string
(
REGEX REPLACE
"^
${
PUGS_SOURCE_DIR
}
/"
""
BASE_SOURCE_FILE
"
${
SOURCE_FILE
}
"
)
math
(
EXPR PROGRESS
"(100*
${
SOURCE_ID
}
)/
${
LIST_SIZE
}
"
)
string
(
LENGTH
${
PROGRESS
}
PROGRESS_SIZE
)
math
(
EXPR NBSPC
"3-
${
PROGRESS_SIZE
}
"
)
string
(
SUBSTRING
" "
0
${
NBSPC
}
PRESPC
)
execute_process
(
COMMAND
"
${
CMAKE_COMMAND
}
"
-E env CLICOLOR_FORCE=1
"
${
CMAKE_COMMAND
}
"
-E cmake_echo_color --green
"Running clazy-standalone on
${
BASE_SOURCE_FILE
}
"
)
"
${
CMAKE_COMMAND
}
"
-E cmake_echo_color --no-newline
"[
${
PRESPC
}${
PROGRESS
}
%] "
--green
"Analyzing
${
BASE_SOURCE_FILE
}
"
)
execute_process
(
COMMAND
"
${
CMAKE_COMMAND
}
"
-E echo
""
)
math
(
EXPR SOURCE_ID
"
${
SOURCE_ID
}
+1"
)
execute_process
(
COMMAND
"
${
CLAZY_STANDALONE
}
"
"-p=
${
PUGS_BINARY_DIR
}
"
"
${
SOURCE_FILE
}
"
COMMAND_ECHO
${
ECHO_CMD_TO
}
RESULT_VARIABLE
clazy_result
)
RESULT_VARIABLE
CLAZY_RESULT
)
if
(
NOT
(
"
${
CLAZY_RESULT
}
"
EQUAL
"0"
))
set
(
CLAZY_FAILED
"1"
)
message
(
"CLAZY_FAILED
${
CLAZY_FAILED
}
"
)
if
(
NOT DEFINED CONTINUE_ON_ERROR
)
if
(
NOT
(
${
clazy_result
}
EQUAL
"0"
))
message
(
FATAL_ERROR
)
break
()
endif
()
endif
()
endforeach
()
if
(
CLAZY_FAILED
)
message
(
FATAL_ERROR
"Clazy encountered errors!"
)
endif
()
endif
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment