Skip to content

Commit

Permalink
Build with debug information for lldb on iOS platform (#302)
Browse files Browse the repository at this point in the history
* Support build with debug information for LLDB (xCode debugger)
* Support —enable-debug as well
  • Loading branch information
Gummilion authored and rndi committed Mar 15, 2018
1 parent dade14d commit 98e86ac
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions scripts/iOS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,14 @@ if (NOT DEFINED IOS_DISABLE_BITCODE)
set (EMBED_OPTIONS "-fembed-bitcode")
endif(NOT DEFINED IOS_DISABLE_BITCODE)

# Hidden visibilty is required for cxx on iOS
set (CMAKE_C_FLAGS_INIT "${EMBED_OPTIONS}")
set (CMAKE_CXX_FLAGS_INIT "-fvisibility=hidden -fvisibility-inlines-hidden ${EMBED_OPTIONS}")
if (CMAKE_BUILD_TYPE STREQUAL "Debug" OR ENABLE_DEBUG)
set(IOS_DEBUG_OPTIONS "-glldb -gmodules")
else()
set(IOS_DEBUG_OPTIONS "-fvisibility=hidden -fvisibility-inlines-hidden")
endif()

set (CMAKE_C_FLAGS_INIT "${IOS_DEBUG_OPTIONS} ${EMBED_OPTIONS}")
set (CMAKE_CXX_FLAGS_INIT "${IOS_DEBUG_OPTIONS} ${EMBED_OPTIONS}")

set (CMAKE_C_LINK_FLAGS "-Wl,-search_paths_first ${EMBED_OPTIONS} ${CMAKE_C_LINK_FLAGS}")
set (CMAKE_CXX_LINK_FLAGS "-Wl,-search_paths_first ${EMBED_OPTIONS} ${CMAKE_CXX_LINK_FLAGS}")
Expand Down

0 comments on commit 98e86ac

Please sign in to comment.