forked from mavlink/qgroundcontrol
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract cmake logic to it's own file
- Loading branch information
1 parent
72fe118
commit 58fd34c
Showing
2 changed files
with
32 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
if(${CMAKE_BUILD_TYPE} MATCHES "Debug") | ||
include(CTest) | ||
enable_testing() | ||
add_definitions(-DUNITTEST_BUILD) | ||
endif() | ||
|
||
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") | ||
# clang and AppleClang | ||
add_compile_options( | ||
-Wall | ||
-Wextra | ||
-Wno-address-of-packed-member # ignore for mavlink | ||
) | ||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") | ||
# GCC | ||
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.9) | ||
add_compile_options(-fdiagnostics-color=always) | ||
endif() | ||
|
||
add_compile_options( | ||
-Wall | ||
-Wextra | ||
) | ||
elseif (WIN32) | ||
add_definitions(-D_USE_MATH_DEFINES) | ||
add_compile_options( | ||
/wd4244 # warning C4244: '=': conversion from 'double' to 'float', possible loss of data | ||
) | ||
endif() |