Skip to content

Commit

Permalink
Fix clang debug build (Android and FreeBSD) (CrowCpp#740)
Browse files Browse the repository at this point in the history
* fix build: android/termux/clang-17.0

* Android build links with liblog in places

* Fix clang debug build (Android and FreeBSD)
  • Loading branch information
keith-dev authored Jan 16, 2024
1 parent 78d1d2b commit a88ec3b
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions cmake/compiler_options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a88ec3b

Please sign in to comment.