forked from Archive/PX4-Autopilot
Merge pull request #2849 from jgoppert/cmake-coding-standard-fix
Fixed confusing else clause, added to coding standard.
This commit is contained in:
commit
2ab9f0baa8
|
@ -53,6 +53,26 @@
|
|||
#
|
||||
# * All cmake functions are lowercase.
|
||||
#
|
||||
# * For else, endif, endfunction, etc, never put the name of the statement
|
||||
#
|
||||
# Instead of the very confusing:
|
||||
# if (${var} STREQUAL "1") <-- condition now becomes if name
|
||||
# # do somthing
|
||||
# elseif (${var} STREQUAL "2") <-- another condition
|
||||
# # do somthing
|
||||
# else (${var} STREQUAL "1") <-- tag is referring to name of if
|
||||
# # do somthing
|
||||
# endif (${var} STREQUAL "1") <-- tag is referring to name of if
|
||||
#
|
||||
# Do this:
|
||||
# if (${var} STREQUAL "1") <-- condition now becomes if name
|
||||
# # do somthing
|
||||
# elseif (${var} STREQUAL "2") <-- another condition
|
||||
# # do somthing
|
||||
# else () <-- leave blank
|
||||
# # do somthing
|
||||
# endif () <-- leave blank
|
||||
#
|
||||
# Functions/Macros
|
||||
# ---------------------------------------------------------------------------
|
||||
#
|
||||
|
|
|
@ -510,7 +510,7 @@ function(px4_add_common_flags)
|
|||
list(APPEND warnings
|
||||
-Wno-unused-const-variable
|
||||
)
|
||||
else(${CMAKE_C_COMPILER_ID} STREQUAL "Clang")
|
||||
else()
|
||||
list(APPEND warnings
|
||||
-Werror=unused-but-set-variable
|
||||
-Wformat=1
|
||||
|
|
Loading…
Reference in New Issue