ClickHouse/contrib/aws-cmake/AwsThreadName.cmake

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
498 B
CMake
Raw Normal View History

2022-11-21 21:29:40 +00:00
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0.
# Check how the platform supports setting thread name
function(aws_set_thread_name_method target)
2023-11-14 06:24:41 +00:00
if (APPLE)
2022-11-21 21:29:40 +00:00
# All Apple platforms we support have the same function, so no need for compile-time check.
return()
endif()
# pthread_setname_np() usually takes 2 args
2023-11-14 06:24:41 +00:00
target_compile_definitions(${target} PRIVATE -DAWS_PTHREAD_SETNAME_TAKES_2ARGS)
2022-11-21 21:29:40 +00:00
endfunction()