Usa una versione personalizzata di clang in Xcode

4

Ho installato la versione recente di clang (in /usr/local/ ). Come posso configurare Xcode per usare questa versione e non la versione integrata di clang?

    
posta A.S. 18.06.2013 - 23:47
fonte

1 risposta

2

Questa è una copia della mia risposta su StackOverflow: Come posso forzare Xcode a utilizzare il compilatore personalizzato? .

People say it is possible with custom toolchains. I didn't make a research on them because easier solution worked well for me:

It is also possible to run frontend plugins directly by setting appropriate "build settings" of Xcode. (Several ways to do this, you can set them on the command line for instance: xcodebuild build FOO=bla.) Here are a few build settings that I found useful to inject C flags:

OTHER_CFLAGS, OTHER_CPLUSPLUSFLAGS or to replace the compiler(s) and linker(s):

CC, CPLUSPLUS, LD, LDPLUSPLUS, LIBTOOL

The same approach works to control the "analyze" action: CLANG_ANALYZER_EXEC, CLANG_ANALYZER_OTHER_FLAGS

Disclaimer: some of those build settings are undocumented (afaik). Use at your own risk.

     

(Tratto da [cfe-dev] Progetti iOS Xcode di compilazione / refactoring )

     

Per me è stato sufficiente definire le seguenti impostazioni definite dall'utente nelle impostazioni di creazione dei progetti Xcode:

     

CC = my-c-compilatore

     

CXX = my-cxx-compilatore

     

Libtool = my-linker-per-static-librerie

    
risposta data 11.04.2017 - 22:36
fonte

Leggi altre domande sui tag