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

[SR-11814] Swift Package Manager needs to generalize pkgConfig #4642

Open
swift-ci opened this issue Nov 20, 2019 · 1 comment
Open

[SR-11814] Swift Package Manager needs to generalize pkgConfig #4642

swift-ci opened this issue Nov 20, 2019 · 1 comment

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-11814
Radar rdar://problem/57348908
Original Reporter rmann (JIRA User)
Type Improvement
Additional Detail from JIRA
Votes 0
Component/s Package Manager
Labels Improvement
Assignee None
Priority Medium

md5: ed54afc42067b7d6cde72111bed36340

Issue Description:

Some libraries, eg SDL, use a tool very much like pkg-config to provide suitable linker and compiler flags, but not pkg-config. In the case of SDL, it's sdl2-config:

On macOS:

$ sdl2-config --libs --cflags
-L/usr/local/lib -lSDL2
-I/usr/local/include/SDL2 -D_THREAD_SAFE

On Raspbian:

$ sdl2-config --libs --cflags
-L/usr/local/lib -Wl,-rpath,/usr/local/lib Wl,-enable-new-dtags -lSDL2
-I/usr/local/include/SDL2 -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux -D_REENTRANT

And pkg-config doesn't work at all for SDL.

Since Package Manager can't reasonably be expected to support each and every config tool out there, it would be nice to be able to include code in Package.swift to do this for it, and provide the flags to SPM.

One approach would be to make pkgConfig support generic, so a different object could be provided. But I looked at the code, and pkgConfig is littered throughout the codebase; it would be challenging to remove it.

Maybe an alternative would be to allow lib and cflags to be passed in at the target level? If this already exists, it's not well-documented.

@beccadax
Copy link
Contributor

@swift-ci create

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants