Skip to content

Commit a549532

Browse files
authored
Add a generic bsd platform for expressions (#1785)
In most places there's a check for either FreeBSD or OpenBSD it should actually check for BSD in general. This will make some expressions cleaner and make adding support for other BSD systems easier.
1 parent 6ad512a commit a549532

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/vcpkg/platform-expression.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ namespace vcpkg::PlatformExpression
2727
linux,
2828
freebsd,
2929
openbsd,
30+
bsd,
3031
solaris,
3132
osx,
3233
uwp,
@@ -62,6 +63,7 @@ namespace vcpkg::PlatformExpression
6263
{"linux", Identifier::linux},
6364
{"freebsd", Identifier::freebsd},
6465
{"openbsd", Identifier::openbsd},
66+
{"bsd", Identifier::bsd},
6567
{"solaris", Identifier::solaris},
6668
{"osx", Identifier::osx},
6769
{"uwp", Identifier::uwp},
@@ -568,6 +570,9 @@ namespace vcpkg::PlatformExpression
568570
case Identifier::linux: return true_if_exists_and_equal("VCPKG_CMAKE_SYSTEM_NAME", "Linux");
569571
case Identifier::freebsd: return true_if_exists_and_equal("VCPKG_CMAKE_SYSTEM_NAME", "FreeBSD");
570572
case Identifier::openbsd: return true_if_exists_and_equal("VCPKG_CMAKE_SYSTEM_NAME", "OpenBSD");
573+
case Identifier::bsd:
574+
return true_if_exists_and_equal("VCPKG_CMAKE_SYSTEM_NAME", "FreeBSD") ||
575+
true_if_exists_and_equal("VCPKG_CMAKE_SYSTEM_NAME", "OpenBSD");
571576
case Identifier::solaris: return true_if_exists_and_equal("VCPKG_CMAKE_SYSTEM_NAME", "SunOS");
572577
case Identifier::osx: return true_if_exists_and_equal("VCPKG_CMAKE_SYSTEM_NAME", "Darwin");
573578
case Identifier::uwp:

0 commit comments

Comments
 (0)