forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge #162: cmake: Switch from tri-state options to boolean. Stage TWO
598eda8 cmake [KILL 3-STATE]: Switch `WITH_USDT` to boolean w/ default OFF (Hennadii Stepanov) f3c2fea fixup! cmake: Add `systemtap-sdt` optional package support (Hennadii Stepanov) Pull request description: Same as #161, but USDT-specific with refactoring of the USDT search logic into its own "FindUSDT" module. The first commit is a pure refactoring. Top commit has no ACKs. Tree-SHA512: 2d67c7e72509fc78eb906a8af93e7525b8125bdeb38a5f45ceda1c0c75f300c74501402c39d8d17de2585b2ed2939de0009a33231d1164438ce929236d4b742a
- Loading branch information
Showing
9 changed files
with
77 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Copyright (c) 2024-present The Bitcoin Core developers | ||
# Distributed under the MIT software license, see the accompanying | ||
# file COPYING or https://opensource.org/license/mit/. | ||
|
||
#[=======================================================================[ | ||
FindUSDT | ||
-------- | ||
Finds the Userspace, Statically Defined Tracing header(s). | ||
Imported Targets | ||
^^^^^^^^^^^^^^^^ | ||
This module provides imported target ``USDT::headers``, if | ||
USDT has been found. | ||
Result Variables | ||
^^^^^^^^^^^^^^^^ | ||
This module defines the following variables: | ||
``USDT_FOUND`` | ||
"True" if USDT found. | ||
#]=======================================================================] | ||
|
||
find_path(USDT_INCLUDE_DIR | ||
NAMES sys/sdt.h | ||
) | ||
mark_as_advanced(USDT_INCLUDE_DIR) | ||
|
||
if(USDT_INCLUDE_DIR) | ||
include(CMakePushCheckState) | ||
cmake_push_check_state(RESET) | ||
|
||
include(CheckCXXSourceCompiles) | ||
set(CMAKE_REQUIRED_INCLUDES ${USDT_INCLUDE_DIR}) | ||
check_cxx_source_compiles(" | ||
#include <sys/sdt.h> | ||
int main() | ||
{ | ||
DTRACE_PROBE(context, event); | ||
int a, b, c, d, e, f, g; | ||
DTRACE_PROBE7(context, event, a, b, c, d, e, f, g); | ||
} | ||
" HAVE_USDT_H | ||
) | ||
|
||
cmake_pop_check_state() | ||
endif() | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(USDT | ||
REQUIRED_VARS USDT_INCLUDE_DIR HAVE_USDT_H | ||
) | ||
|
||
if(USDT_FOUND AND NOT TARGET USDT::headers) | ||
add_library(USDT::headers INTERFACE IMPORTED) | ||
set_target_properties(USDT::headers PROPERTIES | ||
INTERFACE_INCLUDE_DIRECTORIES "${USDT_INCLUDE_DIR}" | ||
INTERFACE_COMPILE_DEFINITIONS ENABLE_TRACING | ||
) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters