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

**URL:** https://discourse.cmake.org/t/help-with-generate-debug-symbols-build-setting-in-xcode-project-generated-by-cmake/11141
**Category:** Usage
**Tags:** os:macos
**Created:** [July 1, 2024, 8:19am UTC](https://discourse.cmake.org/t/help-with-generate-debug-symbols-build-setting-in-xcode-project-generated-by-cmake/11141 "2024-07-01T08:19:34Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![johnwick](https://discourse.cmake.org/user_avatar/discourse.cmake.org/johnwick/32/4711_2.png) [@johnwick](https://discourse.cmake.org/u/johnwick)
#### Post date: [July 1, 2024, 8:19am UTC](https://discourse.cmake.org/t/help-with-generate-debug-symbols-build-setting-in-xcode-project-generated-by-cmake/11141/1 "2024-07-01T08:19:34Z")

</div>

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:

```auto
    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?

---

<div class="post-metadata">

### Author: ![Ygrik2003](https://discourse.cmake.org/user_avatar/discourse.cmake.org/ygrik2003/32/5299_2.png) [@Ygrik2003](https://discourse.cmake.org/u/Ygrik2003)
#### Post date: [April 15, 2025, 1:14pm UTC](https://discourse.cmake.org/t/help-with-generate-debug-symbols-build-setting-in-xcode-project-generated-by-cmake/11141/3 "2025-04-15T13:14:40Z")

</div>

You need set `CMAKE_<LANG>_FLAGS` for all languages, using in project  
it worked for me
