Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

342
Vistas
Avoid automatic framework linking in swift

I have an example project consisting of a main target (LinkerTests) and a dependent dynamic framework (Dynamic).

If you run the project, you will see the following dyld binary load:

dyld: loaded: {DerivedDataPath}/Build/Products/Debug-iphonesimulator/Dynamic.framework/Dynamic

This dyld binary load happens due to import Dynamic in AppDelegate.swift despite of the following:

  1. Link Binary With Libraries build phase is empty
  2. CLANG_MODULES_AUTOLINK is set to false

What I need to achieve is avoiding this automatic implicit linking. Is this possible? Thanks in advance!


Related question: Don't we need to link framework to XCode project anymore?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Apparently this feature is called autolinking. Swift compiler implicitly emits additional linker flags that links in all the modules the source code depends on (import Dynamic).

There is no way to disable this entirely. But there is a private compiler flag that allows you to disable autolinking for a single framework: swiftc -disable-autolink-framework <framework>.

Some references: https://gist.github.com/zrzka/c89705ff634ea01aebc1 https://github.com/niw/automatic_linking_tool/blob/master/README.md

I’m pretty sure you can append -v to swiftc and it will print all underlying invocations as commands. Hopefully you’ll be able to see the linker invocations as well.

You should wrap the the private flag inside two -Xfrontend flags to allow it to be used:

OTHER_SWIFT_FLAGS = "-Xfrontend -disable-autolink-framework -Xfrontend Dynamic"

For this to take effect you must still set Link Frameworks Automatically No under Apple Clang - Language - Modules.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda