File tree Expand file tree Collapse file tree 7 files changed +41
-32
lines changed Expand file tree Collapse file tree 7 files changed +41
-32
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ Changes prior to 3.9.0 are documented as [release notes on GitHub](https://githu
1212### Fixed
1313
1414- CMake option ` ENABLE_TESTS ` (` OFF ` by default) is no longer overwritten by the auto-downloaded C Driver (` ON ` by default) during CMake configuration.
15+ - Static pkg-config files are updated to depend on the static (not shared) libbson / libmongoc packages.
1516
1617## 4.1.0
1718
Original file line number Diff line number Diff line change @@ -5,11 +5,10 @@ set -o pipefail
55
66# Sanity-check that static library macros are not set when building against the shared library.
77# Users don't need to include this section in their projects.
8- (pkg-config --cflags libbsoncxx | grep -v -- -DBSONCXX_STATIC) ||
9- (
10- echo " Expected BSONCXX_STATIC to not be set" >&2
11- exit 1
12- )
8+ if ! pkg-config --cflags libbsoncxx | grep -v -q -- -DBSONCXX_STATIC; then
9+ echo " Expected BSONCXX_STATIC to not be set" >&2
10+ exit 1
11+ fi
1312
1413rm -rf build/*
1514cd build
Original file line number Diff line number Diff line change @@ -5,11 +5,16 @@ set -o pipefail
55
66# Sanity-check that static library macros are set when building against the static library. Users
77# don't need to include this section in their projects.
8- (pkg-config --cflags libbsoncxx-static | grep -- -DBSONCXX_STATIC) ||
9- (
10- echo " Expected BSONCXX_STATIC to be set" >&2
11- exit 1
12- )
8+ if ! pkg-config --cflags libbsoncxx-static | grep -q -- -DBSONCXX_STATIC; then
9+ echo " Expected BSONCXX_STATIC to be set" >&2
10+ exit 1
11+ fi
12+
13+ # Sanity-check that static libbson is required. Regression test for CXX-3290.
14+ if ! pkg-config --print-requires libbsoncxx-static | grep -q -- bson2-static; then
15+ echo " Expected bson2-static to be required" >&2
16+ exit 1
17+ fi
1318
1419rm -rf build/*
1520cd build
Original file line number Diff line number Diff line change @@ -5,16 +5,15 @@ set -o pipefail
55
66# Sanity-check that static library macros are not set when building against the shared library.
77# Users don't need to include this section in their projects.
8- (pkg-config --cflags libmongocxx | grep -v -- -DBSONCXX_STATIC) ||
9- (
10- echo " Expected BSONCXX_STATIC to not be set" >&2
11- exit 1
12- )
13- (pkg-config --cflags libmongocxx | grep -v -- -DMONGOCXX_STATIC) ||
14- (
15- echo " Expected MONGOCXX_STATIC to not be set" >&2
16- exit 1
17- )
8+ if ! pkg-config --cflags libmongocxx | grep -v -q -- -DBSONCXX_STATIC; then
9+ echo " Expected BSONCXX_STATIC to not be set" >&2
10+ exit 1
11+ fi
12+
13+ if ! pkg-config --cflags libmongocxx | grep -v -q -- -DMONGOCXX_STATIC; then
14+ echo " Expected MONGOCXX_STATIC to not be set" >&2
15+ exit 1
16+ fi
1817
1918rm -rf build/*
2019cd build
Original file line number Diff line number Diff line change @@ -5,16 +5,21 @@ set -o pipefail
55
66# Sanity-check that static library macros are set when building against the static library. Users
77# don't need to include this section in their projects.
8- (pkg-config --cflags libmongocxx-static | grep -- -DBSONCXX_STATIC) ||
9- (
10- echo " Expected BSONCXX_STATIC to be set" >&2
11- exit 1
12- )
13- (pkg-config --cflags libmongocxx-static | grep -- -DMONGOCXX_STATIC) ||
14- (
15- echo " Expected MONGOCXX_STATIC to be set" >&2
16- exit 1
17- )
8+ if ! pkg-config --cflags libmongocxx-static | grep -q -- -DBSONCXX_STATIC; then
9+ echo " Expected BSONCXX_STATIC to be set" >&2
10+ exit 1
11+ fi
12+
13+ if ! pkg-config --cflags libmongocxx-static | grep -q -- -DMONGOCXX_STATIC; then
14+ echo " Expected MONGOCXX_STATIC to be set" >&2
15+ exit 1
16+ fi
17+
18+ # Sanity-check that static libmongoc is required. Regression test for CXX-3290.
19+ if ! pkg-config --print-requires libmongocxx-static | grep -q -- mongoc2-static; then
20+ echo " Expected mongoc2-static to be required" >&2
21+ exit 1
22+ fi
1823
1924rm -rf build/*
2025cd build
Original file line number Diff line number Diff line change 2626 set (requires "" )
2727
2828 if (is_static)
29- list (APPEND requires "bson2 >= ${bson_req_ver} " )
29+ list (APPEND requires "bson2-static >= ${bson_req_ver} " )
3030 endif ()
3131
3232 list (JOIN requires ", " requires)
Original file line number Diff line number Diff line change 2828
2929 if (is_static)
3030 list (APPEND requires "lib${bsoncxx_name} >= ${version} " )
31- list (APPEND requires "mongoc2 >= ${mongoc_req_ver} " )
31+ list (APPEND requires "mongoc2-static >= ${mongoc_req_ver} " )
3232 else ()
3333 list (APPEND requires "lib${bsoncxx_name} >= ${version} " )
3434 endif ()
You can’t perform that action at this time.
0 commit comments