Files
tdesktop/cmake/target_link_frameworks.cmake
allhaileris afb81b8278
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Close stale issues and PRs / stale (push) Successful in 13s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
init
2026-02-16 15:50:16 +03:00

47 lines
1.8 KiB
CMake

# This file is part of Desktop App Toolkit,
# a set of libraries for developing nice desktop applications.
#
# For license and copyright information please follow this link:
# https://github.com/desktop-app/legal/blob/master/LEGAL
function(target_link_frameworks_generic type target_name)
set(writing_now "")
set(private_frameworks "")
set(public_frameworks "")
set(interface_frameworks "")
foreach (entry ${ARGN})
if (${entry} STREQUAL "PRIVATE" OR ${entry} STREQUAL "PUBLIC" OR ${entry} STREQUAL "INTERFACE")
set(writing_now ${entry})
else()
set(full_argument "${type} ${entry}")
if ("${writing_now}" STREQUAL "PRIVATE")
list(APPEND private_frameworks ${full_argument})
elseif ("${writing_now}" STREQUAL "PUBLIC")
list(APPEND public_frameworks ${full_argument})
elseif ("${writing_now}" STREQUAL "INTERFACE")
list(APPEND interface_frameworks ${full_argument})
else()
message(FATAL_ERROR "Unknown frameworks scope for target ${target_name}")
endif()
endif()
endforeach()
if (NOT "${public_frameworks}" STREQUAL "")
target_link_libraries(${target_name} PUBLIC ${public_frameworks})
endif()
if (NOT "${private_frameworks}" STREQUAL "")
target_link_libraries(${target_name} PRIVATE ${private_frameworks})
endif()
if (NOT "${interface_frameworks}" STREQUAL "")
target_link_libraries(${target_name} INTERFACE ${interface_frameworks})
endif()
endfunction()
function(target_link_frameworks)
target_link_frameworks_generic("-framework" ${ARGN})
endfunction()
function(target_link_frameworks_weak)
target_link_frameworks_generic("-weak_framework" ${ARGN})
endfunction()