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

Library search path build setting is not set #256

Closed
kwridan opened this issue Mar 5, 2019 · 1 comment · Fixed by #308
Closed

Library search path build setting is not set #256

kwridan opened this issue Mar 5, 2019 · 1 comment · Fixed by #308
Assignees
Labels
type:bug Something isn't working

Comments

@kwridan
Copy link
Collaborator

kwridan commented Mar 5, 2019

Describe the bug
Generated projects fail to build when depending on c / Objective-C static libraries.

To Reproduce

  • Given a prebuilt static library, headers and a module map

e.g.

prebuilt/
├── include
│   └── ObjcStaticLibrary
│       ├── LibraryClass.h
│       ├── ObjcStaticLibrary.h
│       └── module.modulemap
└── libObjcStaticLibrary.a
  • Add a dependency on that static library

e.g.

let project = Project(name: "App",
                      targets: [
                          Target(name: "App",
                                 platform: .iOS,
                                 product: .app,
                                 bundleId: "io.tuist.App",
                                 infoPlist: "Info.plist",
                                 sources: "Sources/**",
                                 dependencies: [
                                     .library(path: "prebuilt/libObjcStaticLibrary.a", publicHeaders: "prebuilt/include", swiftModuleMap: nil)
                          ])
               ])
  • run tuist generate
  • build the generated project

build fails!

Expected behavior
The generated project should build with the following error:

ld: library not found for -lObjcStaticLibrary
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Additional context

Investigating this further, it seem's the LIBRARY_SEARCH_PATHS build setting is not set.
Setting it to $(SRCROOT)/prebuilt fixes the issue.

Let me know if I made some false assumptions in my setup

@kwridan kwridan added the type:bug Something isn't working label Mar 5, 2019
@pepicrft
Copy link
Contributor

pepicrft commented Mar 7, 2019

That seems a legit issue. Good catch @kwridan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants