mirror of
https://gitlab.freedesktop.org/pkg-config/pkg-config.git
synced 2025-12-24 16:50:04 +01:00
Test stripping of duplicate flags
pkg-config aggressively strips all duplicate arguments from the final output it builds. This is not only and optimization, but it also allows the flag ordering to work correctly when a package on the command line is required by another on the command line.
This commit is contained in:
parent
3e54448158
commit
f5b93bf1b1
4 changed files with 40 additions and 1 deletions
|
|
@ -15,6 +15,7 @@ TESTS = \
|
||||||
check-missing \
|
check-missing \
|
||||||
check-idirafter \
|
check-idirafter \
|
||||||
check-sort-order \
|
check-sort-order \
|
||||||
|
check-duplicate-flags \
|
||||||
check-whitespace \
|
check-whitespace \
|
||||||
check-cmd-options \
|
check-cmd-options \
|
||||||
check-version \
|
check-version \
|
||||||
|
|
@ -61,4 +62,6 @@ EXTRA_DIST = \
|
||||||
sort/sort/sort-order-3-2.pc \
|
sort/sort/sort-order-3-2.pc \
|
||||||
sort-order-1-3.pc \
|
sort-order-1-3.pc \
|
||||||
sort/sort-order-2-3.pc \
|
sort/sort-order-2-3.pc \
|
||||||
sort/sort/sort-order-3-3.pc
|
sort/sort/sort-order-3-3.pc \
|
||||||
|
flag-dup-1.pc \
|
||||||
|
flag-dup-2.pc
|
||||||
|
|
|
||||||
15
check/check-duplicate-flags
Executable file
15
check/check-duplicate-flags
Executable file
|
|
@ -0,0 +1,15 @@
|
||||||
|
#! /bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
. ${srcdir}/common
|
||||||
|
|
||||||
|
RESULT="-DPATH2 -DFOO -DPATH1 -I/path/include"
|
||||||
|
run_test --cflags flag-dup-1 flag-dup-2
|
||||||
|
RESULT="-DPATH1 -DFOO -DPATH2 -I/path/include"
|
||||||
|
run_test --cflags flag-dup-2 flag-dup-1
|
||||||
|
|
||||||
|
RESULT="-Wl,--whole-archive --Wl,--no-whole-archive -Xlinker -R /path/lib \
|
||||||
|
-L/path/lib -lpath2 -lpath1 -lm"
|
||||||
|
run_test --libs flag-dup-1 flag-dup-2
|
||||||
|
run_test --libs flag-dup-2 flag-dup-1
|
||||||
10
check/flag-dup-1.pc
Normal file
10
check/flag-dup-1.pc
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
prefix=/path
|
||||||
|
exec_prefix=${prefix}
|
||||||
|
libdir="${exec_prefix}/lib"
|
||||||
|
includedir="${prefix}/include"
|
||||||
|
|
||||||
|
Name: Flag duplicate test 1
|
||||||
|
Description: Test package for checking stripping of duplicate flags
|
||||||
|
Version: 1.0.0
|
||||||
|
Libs: -L${libdir} -lpath1 -Wl,--whole-archive -lm --Wl,--no-whole-archive -Xlinker -R -Xlinker ${libdir}
|
||||||
|
Cflags: -I${includedir} -DPATH1 -DFOO
|
||||||
11
check/flag-dup-2.pc
Normal file
11
check/flag-dup-2.pc
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
prefix=/path
|
||||||
|
exec_prefix=${prefix}
|
||||||
|
libdir="${exec_prefix}/lib"
|
||||||
|
includedir="${prefix}/include"
|
||||||
|
|
||||||
|
Name: Flag duplicate test 2
|
||||||
|
Description: Test package for checking stripping of duplicate flags
|
||||||
|
Version: 1.0.0
|
||||||
|
Libs: -L${libdir} -lpath2 -Wl,--whole-archive -lm --Wl,--no-whole-archive -Xlinker -R -Xlinker ${libdir}
|
||||||
|
Cflags: -I${includedir} -DPATH2 -DFOO
|
||||||
|
Requires: flag-dup-1
|
||||||
Loading…
Add table
Reference in a new issue