mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-13 03:19:58 +03:00
Fix lldb debugging in OSX and improve OSX detection
This commit is contained in:
parent
26145ec17c
commit
688a7e8480
4 changed files with 14 additions and 7 deletions
|
@ -14,10 +14,10 @@ option(SITL "SITL build for host system" OFF)
|
||||||
|
|
||||||
set(TOOLCHAIN_OPTIONS none arm-none-eabi host)
|
set(TOOLCHAIN_OPTIONS none arm-none-eabi host)
|
||||||
if (SITL)
|
if (SITL)
|
||||||
set(TOOLCHAIN "host" CACHE STRING "Toolchain to use. Available: ${TOOLCHAIN_OPTIONS}")
|
if (CMAKE_HOST_APPLE)
|
||||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
|
||||||
set(MACOSX TRUE)
|
set(MACOSX TRUE)
|
||||||
endif()
|
endif()
|
||||||
|
set(TOOLCHAIN "host" CACHE STRING "Toolchain to use. Available: ${TOOLCHAIN_OPTIONS}")
|
||||||
else()
|
else()
|
||||||
set(TOOLCHAIN "arm-none-eabi" CACHE STRING "Toolchain to use. Available: ${TOOLCHAIN_OPTIONS}")
|
set(TOOLCHAIN "arm-none-eabi" CACHE STRING "Toolchain to use. Available: ${TOOLCHAIN_OPTIONS}")
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -16,7 +16,11 @@ set(CMAKE_CXX_COMPILER "g++${TOOL_EXECUTABLE_SUFFIX}" CACHE INTERNAL "c++ compil
|
||||||
set(CMAKE_OBJCOPY "objcopy${TOOL_EXECUTABLE_SUFFIX}" CACHE INTERNAL "objcopy tool")
|
set(CMAKE_OBJCOPY "objcopy${TOOL_EXECUTABLE_SUFFIX}" CACHE INTERNAL "objcopy tool")
|
||||||
set(CMAKE_OBJDUMP "objdump${TOOL_EXECUTABLE_SUFFIX}" CACHE INTERNAL "objdump tool")
|
set(CMAKE_OBJDUMP "objdump${TOOL_EXECUTABLE_SUFFIX}" CACHE INTERNAL "objdump tool")
|
||||||
set(CMAKE_SIZE "size${TOOL_EXECUTABLE_SUFFIX}" CACHE INTERNAL "size tool")
|
set(CMAKE_SIZE "size${TOOL_EXECUTABLE_SUFFIX}" CACHE INTERNAL "size tool")
|
||||||
set(CMAKE_DEBUGGER "gdb${TOOL_EXECUTABLE_SUFFIX}" CACHE INTERNAL "debugger")
|
if(CMAKE_HOST_APPLE)
|
||||||
|
set(CMAKE_DEBUGGER "lldb${TOOL_EXECUTABLE_SUFFIX}" CACHE INTERNAL "debugger")
|
||||||
|
else()
|
||||||
|
set(CMAKE_DEBUGGER "gdb${TOOL_EXECUTABLE_SUFFIX}" CACHE INTERNAL "debugger")
|
||||||
|
endif()
|
||||||
set(CMAKE_CPPFILT "c++filt${TOOL_EXECUTABLE_SUFFIX}" CACHE INTERNAL "c++filt")
|
set(CMAKE_CPPFILT "c++filt${TOOL_EXECUTABLE_SUFFIX}" CACHE INTERNAL "c++filt")
|
||||||
|
|
||||||
set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Build Type" FORCE)
|
set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Build Type" FORCE)
|
||||||
|
@ -24,7 +28,11 @@ set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_CONFIGURATION_TYPES
|
||||||
|
|
||||||
set(debug_options "-Og -O0 -g")
|
set(debug_options "-Og -O0 -g")
|
||||||
set(release_options "-Os -DNDEBUG")
|
set(release_options "-Os -DNDEBUG")
|
||||||
set(relwithdebinfo_options "-ggdb3 ${release_options}")
|
if(CMAKE_HOST_APPLE)
|
||||||
|
set(relwithdebinfo_options "-g ${release_options}")
|
||||||
|
else()
|
||||||
|
set(relwithdebinfo_options "-ggdb3 ${release_options}")
|
||||||
|
endif()
|
||||||
|
|
||||||
set(CMAKE_C_FLAGS_DEBUG ${debug_options} CACHE INTERNAL "c compiler flags debug")
|
set(CMAKE_C_FLAGS_DEBUG ${debug_options} CACHE INTERNAL "c compiler flags debug")
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG ${debug_options} CACHE INTERNAL "c++ compiler flags debug")
|
set(CMAKE_CXX_FLAGS_DEBUG ${debug_options} CACHE INTERNAL "c++ compiler flags debug")
|
||||||
|
|
|
@ -83,7 +83,7 @@ function(setup_executable exe name)
|
||||||
set_target_properties(${exe} PROPERTIES
|
set_target_properties(${exe} PROPERTIES
|
||||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
|
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
|
||||||
)
|
)
|
||||||
if(IS_RELEASE_BUILD)
|
if(IS_RELEASE_BUILD AND NOT CMAKE_HOST_APPLE)
|
||||||
set_target_properties(${exe} PROPERTIES
|
set_target_properties(${exe} PROPERTIES
|
||||||
INTERPROCEDURAL_OPTIMIZATION ON
|
INTERPROCEDURAL_OPTIMIZATION ON
|
||||||
)
|
)
|
||||||
|
|
|
@ -26,7 +26,7 @@ main_sources(SITL_SRC
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
if(CMAKE_HOST_APPLE)
|
||||||
set(MACOSX ON)
|
set(MACOSX ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -61,7 +61,6 @@ if(NOT MACOSX)
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
set(SITL_COMPILE_OPTIONS ${SITL_COMPILE_OPTIONS}
|
set(SITL_COMPILE_OPTIONS ${SITL_COMPILE_OPTIONS}
|
||||||
-Wno-missing-braces
|
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue