1 # SPDX-License-Identifier: 0BSD
3 #############################################################################
5 # tuklib_progname.cmake - see tuklib_progname.m4 for description and comments
9 #############################################################################
11 include("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake")
12 include(CheckSymbolExists)
14 function(tuklib_progname TARGET_OR_ALL)
15 # NOTE: This glibc extension requires _GNU_SOURCE.
16 check_symbol_exists(program_invocation_name errno.h
17 HAVE_PROGRAM_INVOCATION_NAME)
18 tuklib_add_definition_if("${TARGET_OR_ALL}" HAVE_PROGRAM_INVOCATION_NAME)