PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, November 25, 2022

[FIXED] Where are the system-wide Objective-C modules defined in macOS?

 November 25, 2022     module, objective-c     No comments   

Issue

I was interested to inspect globally available modulemaps of Objective-C language under macOS and was wondering if it's possible to add one myself. Is there a way to know where a particular module (e.g. Foundation) is located?

@import Foundation; // Where this comes from?

int main(int argc, const char * argv[]) {
    @autoreleasepool {
        NSLog(@"Hello, world!");
    }
    return 0;
}

Solution

Almost all modules are embedded to the corresponding frameworks in the system. For the latest version of macOS at the time of writing (macOS Monterey 12.6 (21G115)) the frameworks can be found under this directory:

/Library/Developer/CommandLineTools/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks

E.g. Foundation modulemap is located at the path /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Modules/module.modulemap and looks like this:

framework module Foundation [extern_c] [system] {
    umbrella header "Foundation.h"
    
    export *
    module * {
        export *
    }
    
    
    explicit module NSDebug {
        header "NSDebug.h"
        export *
    }
    
    // Use NSItemProvider.h
    exclude header "NSItemProviderReadingWriting.h"
}

The dependencies which were not part of any framework (e.g. libobjc), however, also have modulemaps defined and available under different directory:

/Library/Developer/CommandLineTools/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include


Answered By - The Dreams Wind
Answer Checked By - Senaida (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing