From: Charles Giessen Date: Thu, 17 Feb 2022 23:15:05 +0000 (-0700) Subject: Make _GNU_SOURCE a common target property X-Git-Tag: upstream/1.3.208~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1282d602fa1da6133bdcf9a0056ccb2364cc7ad9;p=platform%2Fupstream%2FVulkan-Loader.git Make _GNU_SOURCE a common target property Rather than set it per target that needs it, make it available on the loader_specific_options target for consistency. --- diff --git a/loader/CMakeLists.txt b/loader/CMakeLists.txt index 98379f5d..34e02ba3 100644 --- a/loader/CMakeLists.txt +++ b/loader/CMakeLists.txt @@ -106,6 +106,12 @@ if(WIN32) # Configure the file to include the versioning info # Place it in the current directory for check-in - so the GN build has up to date info configure_file(loader.rc.in ${CMAKE_CURRENT_LIST_DIR}/loader.rc) +else() + # Used to make alloca() and secure_getenv() available + target_compile_definitions(loader_specific_options INTERFACE _GNU_SOURCE) + if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") + target_compile_definitions(loader_specific_options INTERFACE __BSD_VISIBLE=1) + endif() endif() set(NORMAL_LOADER_SRCS @@ -276,12 +282,7 @@ else() if (NOT ANDROID) target_link_libraries(vulkan Threads::Threads) endif() - # Used to make alloca() and secure_getenv() available - target_compile_definitions(vulkan PRIVATE _GNU_SOURCE) - if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") - target_compile_definitions(vulkan PRIVATE __BSD_VISIBLE=1) - target_compile_definitions(asm_offset PRIVATE __BSD_VISIBLE=1) - endif() + if(APPLE) find_library(COREFOUNDATION_LIBRARY NAMES CoreFoundation) target_link_libraries(vulkan "-framework CoreFoundation")