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

cps-config returns no cflags and wrong link flags #101

Open
madebr opened this issue Aug 22, 2024 · 0 comments
Open

cps-config returns no cflags and wrong link flags #101

madebr opened this issue Aug 22, 2024 · 0 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@madebr
Copy link

madebr commented Aug 22, 2024

The script at the bottom of this post creates a dummy prefix looking as:

/tmp/dummyprefix
├── include
│   └── Futuro3
│       ├── Futuro.h
│       └── Futuro_test.h
└── lib
    ├── cps
    │   └── Futuro3.cps
    ├── libFuturo3.a
    ├── libFuturo3.so -> libFuturo3.so.0.1.2
    ├── libFuturo3.so.0 -> libFuturo3.so.0.1.2
    ├── libFuturo3.so.0.1.2
    └── libFuturo3_test.a

Actual output:

+ cps-config flags --cflags Futuro3

+ cps-config flags --libs Futuro3
-l/tmp/dummyprefix/lib/libFuturo3.so.0.1.2

Expected output:

+ cps-config flags --cflags Futuro3
-I/tmp/dummyprefix/include
+ cps-config flags --libs Futuro3
/tmp/dummyprefix/lib/libFuturo3.so.0.1.2

Script to create a dummy project:

#!/bin/sh

set -ex

cd /tmp
rm -rf dummyprefix
mkdir -p dummyprefix/lib/cps
mkdir -p dummyprefix/include/Futuro3
touch  dummyprefix/include/Futuro3/Futuro.h
touch dummyprefix/include/Futuro3/Futuro_test.h
touch dummyprefix/lib/libFuturo3.so.0.1.2
ln -s -r dummyprefix/lib/libFuturo3.so.0.1.2 dummyprefix/lib/libFuturo3.so.0 
ln -s -r dummyprefix/lib/libFuturo3.so.0 dummyprefix/lib/libFuturo3.so
touch dummyprefix/lib/libFuturo3.a
touch dummyprefix/lib/libFuturo3_test.a

cat >dummyprefix/lib/cps/Futuro3.cps <<EOF
{
  "name": "Futuro3",
  "cps_version": "0.10.0",
  "description": "The Future is now",
  "license": "zlib",
  "version": "3.1.2",
  "compat_version": "3.0",
  "platform": {
    "kernel": "linux"
  },
  "default_components": [ "Futuro3" ],
  "components": {
    "Headers": {
      "type": "interface",
      "includes": [ "@prefix@/include" ]
    },
    "Futuro3-shared": {
      "type": "dylib",
      "location": "@prefix@/lib/libFuturo3.so.0.1.2",
      "requires": [ ":Headers" ]
    },
    "Futuro3-static": {
      "type": "archive",
      "location": "@prefix@/lib/libFuturo3.a",
      "requires": [ ":Headers" ]
    },
    "Futuro3_test": {
      "type": "archive",
      "location": "@prefix@/lib/libFuturo3_test.a",
      "requires": [ ":Headers" ]
    },
    "Futuro3": {
      "type": "interface",
      "requires": [ ":Futuro3-shared" ]
    }
  }
}
EOF

tree /tmp/dummyprefix
export CPS_PREFIX_PATH=/tmp/dummyprefix
cps-config flags --cflags Futuro3 || true
cps-config flags --libs Futuro3 || true
@madebr madebr changed the title cps-config returns returns no cflags and wrong link flags cps-config returns no cflags and wrong link flags Aug 23, 2024
@bretbrownjr bretbrownjr added bug Something isn't working help wanted Extra attention is needed labels Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants