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

Can't build with copied sources #211

Closed
1 task done
Luten opened this issue May 13, 2020 · 4 comments
Closed
1 task done

Can't build with copied sources #211

Luten opened this issue May 13, 2020 · 4 comments

Comments

@Luten
Copy link

Luten commented May 13, 2020

Please help prevent duplicate issues before submitting a new one:

Report

What did you do?

  1. Copied contents of Down/Source into my project (I can't reference external frameworks)
  2. Tried to build project

What did you expect to happen?

I expected the project to build successfully

What happened instead?

  1. Build failed with error: unknown type name 'cmark_reference_map' in inlines.h
    • Fixed it by adding #include <references.h> in inlines.h
  2. Build failed with multiple errors: No such module 'libcmark'
    • Tried removing import (thought module is not needed when sources are in same project) - that was a wrong way

That all happens Xcode 11.4.1, Legacy Build System.
Gonna give a try on New Build System

Maybe there is a guide on using Down as copied sources?

P.S: building with Down as CocoaPods dependency works fine

@Luten Luten changed the title Can't build from sources Can't build with copied sources May 13, 2020
@Luten
Copy link
Author

Luten commented May 13, 2020

Looks like libcmark module is used to import c code in swift, so removing import was a wrong way.

Then the problem is No such module 'libcmark' - issue updated

@Luten
Copy link
Author

Luten commented May 13, 2020

Found that path to libcmark module.modulemap should be added to Swift Compiler - Import Paths.
Now receiving a lot of Could not build module 'Foundation' errors.
I suggest an importing loop created by cmark

@Luten
Copy link
Author

Luten commented May 21, 2020

Finally I've built it.
Can't say exactly what caused the problem, feels like some Xcode cache or bug resolved itself on 50th try of the settings that should work
Mostly I did what all guides say:

  • Add C sources
  • Create modulemap (cmark/include/module.modulemap)

In Podspec:

  • spec.source_files - add sources
  • spec.preservepath - add modulemap and .inc files
  • spec.pod_target_xcconfig - add 'SWIFT_INCLUDE_PATHS' => '$(PODS_TARGET_SRCROOT)/<path to cmark modulemap>'
  • Also had to configure spec.public_header_files, as pod generated umbrella caused build errors like unknown type name 'cmark_reference_map' in Unable to build Swift package in Xcode 11.4.1 #209

@Luten Luten closed this as completed May 21, 2020
@iwasrobbed-ks
Copy link
Collaborator

I'm a bit confused @Luten ; are you integrating it via pods or manually?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants