Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions eng/native/configurecompiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ if (CLR_CMAKE_HOST_UNIX)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wno-null-conversion)
add_compile_options(-glldb)
if (CLR_CMAKE_TARGET_ANDROID)
add_compile_options(-gz=zlib)
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-gz=zlib is added unconditionally for Android/Clang. Since this is a non-trivial compiler flag (and Android builds can use different NDK/Clang versions), please gate it with a compiler-flag support check (e.g., check_c_compiler_flag/check_cxx_compiler_flag) before adding it. That will prevent hard build breaks on toolchains that don’t recognize -gz or the =zlib value.

Suggested change
add_compile_options(-gz=zlib)
check_c_compiler_flag("-gz=zlib" C_COMPILER_SUPPORTS_GZ_ZLIB)
check_cxx_compiler_flag("-gz=zlib" CXX_COMPILER_SUPPORTS_GZ_ZLIB)
if (C_COMPILER_SUPPORTS_GZ_ZLIB AND CXX_COMPILER_SUPPORTS_GZ_ZLIB)
add_compile_options(-gz=zlib)
endif()

Copilot uses AI. Check for mistakes.
endif()
else()
add_compile_options(-g)
endif()
Expand Down
Loading