From a88ec3bf64f8476f2b61b0ee8dc3a3dfd99994d9 Mon Sep 17 00:00:00 2001 From: keith-dev Date: Tue, 16 Jan 2024 19:19:06 +0000 Subject: [PATCH] Fix clang debug build (Android and FreeBSD) (#740) * fix build: android/termux/clang-17.0 * Android build links with liblog in places * Fix clang debug build (Android and FreeBSD) --- cmake/compiler_options.cmake | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/cmake/compiler_options.cmake b/cmake/compiler_options.cmake index ffe1d017c..133ee1461 100644 --- a/cmake/compiler_options.cmake +++ b/cmake/compiler_options.cmake @@ -11,6 +11,27 @@ function(add_warnings_optimizations target_name) $<$:/Zi /O2 /Ob1> $<$:/Zi /Ob0 /Od /RTC1> ) + elseif(NOT CMAKE_COMPILER_IS_GNU AND + "${CMAKE_SYSTEM_NAME}" STREQUAL "Android") + # clang on Android, no prof/gprof + target_compile_options(${target_name} + PRIVATE + -Wall + -Wextra + -Wpedantic + $<$:-O2> + $<$:-O0 -g> + ) + elseif(NOT CMAKE_COMPILER_IS_GNU) + # clang, no prof + target_compile_options(${target_name} + PRIVATE + -Wall + -Wextra + -Wpedantic + $<$:-O2> + $<$:-O0 -g -pg> + ) else() target_compile_options(${target_name} PRIVATE