2

The question seems strange I know. I am porting a project to Apple Silicon + Intel, and I have a strange issue with linking. In the project there was a library that was originally embedded in the project by adding all its source files, while I am trying to remove the real files from the project and replace them with a Swift Package Dependency. After this process, I have just a few symbols missing for arm64 architecture that are declared in a .m file which is not part of any target. Everything normal so far. The strange thing is that if I add the .m file with the symbols to the target, I get duplicate definitions for architecture x86_64 for those symbols. I would like to make the .m file part of the target, but I would like to prefix the symbol declarations with something like:

#ifdef (arm64)
BOOL findOutYesOrNot() {
   return YES;
}
#endif

This could make the symbols available to arm64 and not duplicate on x86_64. Is this possible in some way ? Thanks a lot for any help.

Alfonso Tesauro
  • 1,730
  • 13
  • 21
  • Not strange nor new, maybe https://stackoverflow.com/questions/23934862/what-predefined-macro-can-i-use-to-detect-the-target-architecture-in-clang/41666292 – skaak Dec 19 '20 at 02:25

0 Answers0