Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
solverstack
morse_cmake
Commits
6e4d325d
Commit
6e4d325d
authored
Apr 10, 2018
by
Mathieu Faverge
Browse files
Add rule to undef unused precision for sonarqube
parent
88884a24
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/RulesPrecisions.cmake
View file @
6e4d325d
...
...
@@ -233,16 +233,21 @@ MACRO(precisions_rules_py)
# We generate a dependency only if a file will be generated
if
(
got_file
)
set
(
_compile_flags
"-DPRECISION_
${
_dependency_PREC
}
"
)
set
(
_listtmp
${
PREC_RULE_PRECISIONS
}
)
list
(
REMOVE_ITEM _listtmp
${
_dependency_PREC
}
)
foreach
(
_prec
${
_listtmp
}
)
set
(
_compile_flags
"
${
_compile_flags
}
-UPRECISION_
${
_prec
}
"
)
endforeach
()
if
(
generate_out
)
# the custom command is executed in CMAKE_CURRENT_BINARY_DIR
ADD_CUSTOM_COMMAND
(
OUTPUT
${
_dependency_OUTPUT
}
COMMAND
${
CMAKE_COMMAND
}
-E remove -f
${
_dependency_OUTPUT
}
&&
${
pythoncmd
}
&& chmod a-w
${
_dependency_OUTPUT
}
DEPENDS
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
_dependency_INPUT
}
${
RP_CODEGEN
}
${
RP_
${
CMAKE_PROJECT_NAME
}
_DICTIONNARY
}
)
set_source_files_properties
(
${
_dependency_OUTPUT
}
PROPERTIES COMPILE_FLAGS
"-DPRECISION_
${
_dependency_PREC
}
"
GENERATED 1 IS_IN_BINARY_DIR 1
)
set_source_files_properties
(
${
_dependency_OUTPUT
}
PROPERTIES COMPILE_FLAGS
${
_compile_flags
}
GENERATED 1 IS_IN_BINARY_DIR 1
)
else
(
generate_out
)
set_source_files_properties
(
${
_dependency_OUTPUT
}
PROPERTIES COMPILE_FLAGS
"-DPRECISION_
${
_dependency_PREC
}
"
GENERATED 0
)
set_source_files_properties
(
${
_dependency_OUTPUT
}
PROPERTIES COMPILE_FLAGS
${
_compile_flags
}
GENERATED 0
)
endif
(
generate_out
)
list
(
APPEND
${
OUTPUTLIST
}
${
_dependency_OUTPUT
}
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment