Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix swift compilation #611

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1133,33 +1133,36 @@ private PodSpec createPodSpec(JSONObject specJson, PodSpec parent, File podsDir,

// module map
// https://guides.cocoapods.org/syntax/podspec.html#module_map
spec.iosModuleMap = (String)specJson.get("module_map");
spec.osxModuleMap = (String)specJson.get("module_map");
if (ios != null) spec.iosModuleMap = (String)ios.get("module_map");
if (osx != null) spec.osxModuleMap = (String)osx.get("module_map");

if (spec.iosModuleMap != null && spec.iosModuleMap.toLowerCase().equals("false")) {
if (ios != null) {
spec.iosModuleMap = (String)ios.getOrDefault("module_map", "true");
} else {
spec.iosModuleMap = (String)specJson.getOrDefault("module_map", "true");
}
String moduleMapValue = spec.iosModuleMap.toLowerCase();
if (moduleMapValue.equals("false")) {
// do not generate a module map
spec.iosModuleMap = null;
}
else if (spec.iosModuleMap == null && spec.installed) {
if (ExtenderUtil.listFilesMatchingRecursive(spec.dir, "module.modulemap").isEmpty()) {
spec.iosModuleMap = createIosModuleMap(spec, jobDir);
}
LOGGER.info("iOS module map generation skipped for {}", spec.name);
} else if (spec.installed && moduleMapValue.equals("true")) {
spec.iosModuleMap = createIosModuleMap(spec, jobDir);
}
if (spec.iosModuleMap != null) {
spec.flags.ios.objc.add("-fmodule-map-file=" + spec.iosModuleMap);
spec.flags.ios.objcpp.add("-fmodule-map-file=" + spec.iosModuleMap);
}

if (spec.osxModuleMap != null && spec.osxModuleMap.toLowerCase().equals("false")) {
if (osx != null) {
spec.osxModuleMap = (String)osx.getOrDefault("module_map", "true");
} else {
spec.osxModuleMap = (String)specJson.getOrDefault("module_map", "true");
}
moduleMapValue = spec.osxModuleMap.toLowerCase();
if (moduleMapValue.equals("false")) {
// do not generate a module map
spec.osxModuleMap = null;
}
else if (spec.osxModuleMap == null && spec.installed) {
if (ExtenderUtil.listFilesMatchingRecursive(spec.dir, "module.modulemap").isEmpty()) {
spec.osxModuleMap = createOsxModuleMap(spec, jobDir);
}
LOGGER.info("OSX module map generation skipped for {}", spec.name);
} else if (spec.installed && moduleMapValue.equals("true")) {
spec.osxModuleMap = createOsxModuleMap(spec, jobDir);
}
if (spec.osxModuleMap != null) {
spec.flags.osx.objc.add("-fmodule-map-file=" + spec.osxModuleMap);
Expand Down