Help with "Generate Debug Symbols" - build setting in Xcode project generated by CMake

  1. I’m trying to generate Xcode project file of some libraries with CMake.
  2. I want to generate dSYM file in all build config type.
  3. I set values in all my CMakelists.txt as below:
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
    set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf-with-dsym")
  1. After CMake generate my xcodeproj file, I find out “Generate Debug Symbols” is set to true in Debug but set to false in Release build type

  2. I only find it happened in one library, and other libraries worked perfectly.

  3. Does anyone have a clue?