mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-06 05:01:25 -07:00
CMake: detect required header for STACKTRACE feature
musl does not provide execinfo.h, so our current stacktrace-related code cannot be used with it.
This commit is contained in:
parent
d484c0e7ce
commit
137e455f03
1 changed files with 13 additions and 0 deletions
|
@ -19,6 +19,7 @@ set(minLibtorrentVersion 1.2.11)
|
||||||
set(minZlibVersion 1.2.11)
|
set(minZlibVersion 1.2.11)
|
||||||
|
|
||||||
# features (some are platform-specific)
|
# features (some are platform-specific)
|
||||||
|
include(CheckCXXSourceCompiles) # TODO: migrate to CheckSourceCompiles in CMake >= 3.19
|
||||||
include(FeatureSummary)
|
include(FeatureSummary)
|
||||||
include(FeatureOptionsSetup)
|
include(FeatureOptionsSetup)
|
||||||
feature_option(STACKTRACE "Enable stacktraces" ON)
|
feature_option(STACKTRACE "Enable stacktraces" ON)
|
||||||
|
@ -34,6 +35,18 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
"Install systemd service file to a directory manually overridable with Systemd_SERVICES_INSTALL_DIR"
|
"Install systemd service file to a directory manually overridable with Systemd_SERVICES_INSTALL_DIR"
|
||||||
OFF "NOT GUI" OFF
|
OFF "NOT GUI" OFF
|
||||||
)
|
)
|
||||||
|
if (STACKTRACE)
|
||||||
|
check_cxx_source_compiles(
|
||||||
|
"#include <execinfo.h>
|
||||||
|
int main(){return 0;}"
|
||||||
|
QBITTORRENT_HAS_EXECINFO_H
|
||||||
|
)
|
||||||
|
if (NOT QBITTORRENT_HAS_EXECINFO_H)
|
||||||
|
message(FATAL_ERROR "execinfo.h header file not found.\n"
|
||||||
|
"Please either disable the STACKTRACE feature or use a libc that has this header file, such as glibc (GNU libc)."
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
elseif (MSVC)
|
elseif (MSVC)
|
||||||
feature_option(MSVC_RUNTIME_DYNAMIC "Use MSVC dynamic runtime library (-MD) instead of static (-MT)" ON)
|
feature_option(MSVC_RUNTIME_DYNAMIC "Use MSVC dynamic runtime library (-MD) instead of static (-MT)" ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue