Can I use environment variables or a tilde in the .modulemap module?

My file is module.modulemapas follows:

module CompanyInternalSDK {
    header "~/Company/CompanyInternalSDK.framework/Headers/CompanyInternalSDK.h"
    export *
}

However, I get this error:

/Users/username/Path/To/Project/CompanyInternalSDK/module.modulemap:2:12: error: header '~/Company/CompanyInternalSDK.framework/Headers/CompanyInternalSDK.h' not found
    header "~/Company/CompanyInternalSDK.framework/Headers/CompanyInternalSDK.h"
           ^

It compiles fine when I use an absolute path without a tilde, but since it will be distributed like this to all developers, I want to use a tilde. Is there any way to do this right?


I also tried using the environment variable in the string header, but that didn't work either:

module CompanyInternalSDK {
    header "${HOME}/Company/CompanyInternalSDK.framework/Headers/CompanyInternalSDK.h"
    export *
}
/Users/username/Path/To/Project/CompanyInternalSDK/module.modulemap:2:12: error: header '${HOME}/Company/CompanyInternalSDK.framework/Headers/CompanyInternalSDK.h' not found
    header "${HOME}/Company/CompanyInternalSDK.framework/Headers/CompanyInternalSDK.h"
           ^
+4
source share
1 answer

, modulemap . stat , , , .

. , . , , , .

+3

Source: https://habr.com/ru/post/1676077/


All Articles