Skip to content

utils: remove Host, Build, Target duplication #80024

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 0 additions & 32 deletions Runtimes/Overlay/cmake/modules/ResourceEmbedding.cmake
Original file line number Diff line number Diff line change
@@ -1,35 +1,3 @@
function(generate_plist project_name project_version target)
set(PLIST_INFO_PLIST "Info.plist")
set(PLIST_INFO_NAME "${project_name}")

# Underscores aren't permitted in the bundle identifier.
string(REPLACE "_" "" PLIST_INFO_UTI "com.apple.dt.runtime.${PLIST_INFO_NAME}")
set(PLIST_INFO_VERSION "${project_version}")
set(PLIST_INFO_BUILD_VERSION "${project_version}")

set(PLIST_INFO_PLIST_OUT "${PLIST_INFO_PLIST}")
set(PLIST_INFO_PLIST_IN "${PROJECT_SOURCE_DIR}/${PLIST_INFO_PLIST}.in")

if(APPLE)
target_link_options(${target} PRIVATE
"SHELL:-Xlinker -sectcreate -Xlinker __TEXT -Xlinker __info_plist -Xlinker ${CMAKE_CURRENT_BINARY_DIR}/${PLIST_INFO_PLIST_OUT}")
endif()

configure_file(
"${PLIST_INFO_PLIST_IN}"
"${PLIST_INFO_PLIST_OUT}"
@ONLY
NEWLINE_STYLE UNIX)

set_property(TARGET ${target} APPEND PROPERTY LINK_DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${PLIST_INFO_PLIST_OUT}")

# If Application Extensions are enabled, pass the linker flag marking
# the dylib as safe.
if (CXX_SUPPORTS_FAPPLICATION_EXTENSION AND (NOT DISABLE_APPLICATION_EXTENSION))
list(APPEND link_flags "-Wl,-application_extension")
endif()
endfunction()

# FIXME: it appears that `CMAKE_MT` evaluates to an empty string which prevents
# the use of the variable. This aliases `MT` to `CMAKE_MT` and tries to fallback
# to known spellings for the tool.
Expand Down
Loading