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)
This commit is contained in:
keith-dev 2024-01-16 19:19:06 +00:00 committed by GitHub
parent 78d1d2bfba
commit a88ec3bf64
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 21 additions and 0 deletions

View File

@ -11,6 +11,27 @@ function(add_warnings_optimizations target_name)
$<$<CONFIG:RELWITHDEBINFO>:/Zi /O2 /Ob1>
$<$<CONFIG:DEBUG>:/Zi /Ob0 /Od /RTC1>
)
elseif(NOT CMAKE_COMPILER_IS_GNU<C++> AND
"${CMAKE_SYSTEM_NAME}" STREQUAL "Android")
# clang on Android, no prof/gprof
target_compile_options(${target_name}
PRIVATE
-Wall
-Wextra
-Wpedantic
$<$<CONFIG:RELEASE>:-O2>
$<$<CONFIG:DEBUG>:-O0 -g>
)
elseif(NOT CMAKE_COMPILER_IS_GNU<C++>)
# clang, no prof
target_compile_options(${target_name}
PRIVATE
-Wall
-Wextra
-Wpedantic
$<$<CONFIG:RELEASE>:-O2>
$<$<CONFIG:DEBUG>:-O0 -g -pg>
)
else()
target_compile_options(${target_name}
PRIVATE