mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 09:28:58 +00:00
Remove policy that broke posix and fix gcc warning
A Clang only flag was set for all builds. Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
@@ -142,7 +142,6 @@ project(px4 CXX C ASM)
|
|||||||
if (NOT ${CMAKE_VERSION} VERSION_LESS 3.0.0)
|
if (NOT ${CMAKE_VERSION} VERSION_LESS 3.0.0)
|
||||||
cmake_policy(SET CMP0045 NEW) # error on non-existent target in get prop
|
cmake_policy(SET CMP0045 NEW) # error on non-existent target in get prop
|
||||||
cmake_policy(SET CMP0046 NEW) # no non-existent targets as dependencies
|
cmake_policy(SET CMP0046 NEW) # no non-existent targets as dependencies
|
||||||
cmake_policy(SET CMP0054 NEW) # don't dereference quoted variables
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(version_major 1)
|
set(version_major 1)
|
||||||
|
|||||||
@@ -498,7 +498,6 @@ function(px4_add_common_flags)
|
|||||||
-Werror=reorder
|
-Werror=reorder
|
||||||
-Werror=uninitialized
|
-Werror=uninitialized
|
||||||
-Werror=init-self
|
-Werror=init-self
|
||||||
-Wno-unused-const-variable
|
|
||||||
#-Wcast-qual - generates spurious noreturn attribute warnings,
|
#-Wcast-qual - generates spurious noreturn attribute warnings,
|
||||||
# try again later
|
# try again later
|
||||||
#-Wconversion - would be nice, but too many "risky-but-safe"
|
#-Wconversion - would be nice, but too many "risky-but-safe"
|
||||||
@@ -507,7 +506,11 @@ function(px4_add_common_flags)
|
|||||||
# but generates too many false positives
|
# but generates too many false positives
|
||||||
)
|
)
|
||||||
|
|
||||||
if (NOT ${CMAKE_C_COMPILER_ID} STREQUAL "Clang")
|
if (${CMAKE_C_COMPILER_ID} STREQUAL "Clang")
|
||||||
|
list(APPEND warnings
|
||||||
|
-Wno-unused-const-variable
|
||||||
|
)
|
||||||
|
else(${CMAKE_C_COMPILER_ID} STREQUAL "Clang")
|
||||||
list(APPEND warnings
|
list(APPEND warnings
|
||||||
-Werror=unused-but-set-variable
|
-Werror=unused-but-set-variable
|
||||||
-Wformat=1
|
-Wformat=1
|
||||||
|
|||||||
Reference in New Issue
Block a user