johnxnguyen / Down

Blazing fast Markdown / CommonMark rendering in Swift, built upon cmark.
Other
2.24k stars 320 forks source link

Can't build with copied sources #211

Closed Luten closed 4 years ago

Luten commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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:

In Podspec:

iwasrobbed-ks commented 4 years ago

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