Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/vcpkg-tools.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"os": {
"type": "string",
"description": "The platform where the record is valid.",
"enum": [ "windows", "osx", "linux", "freebsd", "openbsd", "netbsd", "solaris" ]
"enum": [ "windows", "osx", "linux", "freebsd", "openbsd", "netbsd", "dragonfly", "solaris" ]
},
"version": {
"type": "string",
Expand Down
1 change: 1 addition & 0 deletions include/vcpkg/tools.test.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ namespace vcpkg
FreeBsd,
OpenBsd,
NetBsd,
DragonFly,
Solaris,
};

Expand Down
2 changes: 1 addition & 1 deletion src/vcpkg-test/tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ TEST_CASE ("parse_tool_data errors", "[tools]")
REQUIRE(!invalid_os.has_value());
CHECK(
"invalid_os.json: error: $.tools[0].os (a tool data operating system): Invalid tool operating system: notanos. "
"Expected one of: windows, osx, linux, freebsd, openbsd, netbsd, solaris" == invalid_os.error());
"Expected one of: windows, osx, linux, freebsd, openbsd, netbsd, dragonfly, solaris" == invalid_os.error());

auto invalid_version = parse_tool_data(R"(
{
Expand Down
2 changes: 1 addition & 1 deletion src/vcpkg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#pragma comment(lib, "shell32")
#endif

#if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
#if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
#define TEST_LIBCURL_AVAILABLE
#include <dlfcn.h>
#endif
Expand Down
2 changes: 2 additions & 0 deletions src/vcpkg/base/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,8 @@ namespace vcpkg
return "openbsd";
#elif defined(__NetBSD__)
return "netbsd";
#elif defined(__DragonFly__)
return "dragonfly";
#elif defined(__SVR4) && defined(__sun)
return "solaris";
#elif defined(__ANDROID__)
Expand Down
8 changes: 5 additions & 3 deletions src/vcpkg/base/system.mac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#if !defined(_WIN32)
#include <net/if.h>
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
#include <ifaddrs.h>

#include <net/if_dl.h>
Expand Down Expand Up @@ -158,7 +158,8 @@ namespace vcpkg
}
}
}
#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || \
defined(__NetBSD__) || defined(__DragonFly__)
// The getifaddrs(ifaddrs** ifap) function creates a linked list of structures
// describing the network interfaces of the local system, and stores
// the address of the first item of the list in *ifap.
Expand Down Expand Up @@ -199,7 +200,8 @@ namespace vcpkg
auto address = reinterpret_cast<sockaddr_ll*>(interface->ifa_addr);
if (address->sll_halen != MAC_BYTES_LENGTH) continue;
auto mac_bytes = Span<char>(reinterpret_cast<char*>(address->sll_addr), MAC_BYTES_LENGTH);
#elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
#elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || \
defined(__DragonFly__)
auto address = reinterpret_cast<sockaddr_dl*>(interface->ifa_addr);
if (address->sdl_alen != MAC_BYTES_LENGTH) continue;
// The macro LLADDR() returns the start of the link-layer network address.
Expand Down
4 changes: 2 additions & 2 deletions src/vcpkg/base/system.process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ extern char** environ;
#include <mach-o/dyld.h>
#endif

#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
extern char** environ;
#include <sys/sysctl.h>
#include <sys/wait.h>
Expand Down Expand Up @@ -261,7 +261,7 @@ namespace vcpkg
auto written = readlink(procpath, buf, sizeof(buf));
Checks::check_exit(VCPKG_LINE_INFO, written != -1, "Could not determine current executable path.");
return Path(buf, written);
#elif defined(__linux__) || defined(__NetBSD__)
#elif defined(__linux__) || defined(__NetBSD__) || defined(__DragonFly__)
char buf[1024 * 4] = {};
auto written = readlink("/proc/self/exe", buf, sizeof(buf));
Checks::check_exit(VCPKG_LINE_INFO, written != -1, "Could not determine current executable path.");
Expand Down
4 changes: 4 additions & 0 deletions src/vcpkg/commands.build.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1000,6 +1000,10 @@ namespace vcpkg
{
return m_paths.scripts / "toolchains/netbsd.cmake";
}
else if (cmake_system_name == "DragonFly")
{
return m_paths.scripts / "toolchains/dragonfly.cmake";
}
else if (cmake_system_name == "SunOS")
{
return m_paths.scripts / "toolchains/solaris.cmake";
Expand Down
7 changes: 6 additions & 1 deletion src/vcpkg/platform-expression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ namespace vcpkg::PlatformExpression
freebsd,
openbsd,
netbsd,
dragonfly,
bsd,
solaris,
osx,
Expand Down Expand Up @@ -67,6 +68,7 @@ namespace vcpkg::PlatformExpression
{"freebsd", Identifier::freebsd},
{"openbsd", Identifier::openbsd},
{"netbsd", Identifier::netbsd},
{"dragonfly", Identifier::dragonfly},
{"bsd", Identifier::bsd},
{"solaris", Identifier::solaris},
{"osx", Identifier::osx},
Expand Down Expand Up @@ -686,10 +688,13 @@ namespace vcpkg::PlatformExpression
case Identifier::freebsd: return true_if_exists_and_equal("VCPKG_CMAKE_SYSTEM_NAME", "FreeBSD");
case Identifier::openbsd: return true_if_exists_and_equal("VCPKG_CMAKE_SYSTEM_NAME", "OpenBSD");
case Identifier::netbsd: return true_if_exists_and_equal("VCPKG_CMAKE_SYSTEM_NAME", "NetBSD");
case Identifier::dragonfly:
return true_if_exists_and_equal("VCPKG_CMAKE_SYSTEM_NAME", "DragonFly");
case Identifier::bsd:
return true_if_exists_and_equal("VCPKG_CMAKE_SYSTEM_NAME", "FreeBSD") ||
true_if_exists_and_equal("VCPKG_CMAKE_SYSTEM_NAME", "OpenBSD") ||
true_if_exists_and_equal("VCPKG_CMAKE_SYSTEM_NAME", "NetBSD");
true_if_exists_and_equal("VCPKG_CMAKE_SYSTEM_NAME", "NetBSD") ||
true_if_exists_and_equal("VCPKG_CMAKE_SYSTEM_NAME", "DragonFly");
case Identifier::solaris: return true_if_exists_and_equal("VCPKG_CMAKE_SYSTEM_NAME", "SunOS");
case Identifier::osx: return true_if_exists_and_equal("VCPKG_CMAKE_SYSTEM_NAME", "Darwin");
case Identifier::uwp:
Expand Down
3 changes: 3 additions & 0 deletions src/vcpkg/tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ namespace
{"freebsd", ToolOs::FreeBsd},
{"openbsd", ToolOs::OpenBsd},
{"netbsd", ToolOs::NetBsd},
{"dragonfly", ToolOs::DragonFly},
{"solaris", ToolOs::Solaris},
};
}
Expand Down Expand Up @@ -180,6 +181,8 @@ namespace vcpkg
auto data = get_raw_tool_data(tool_data_table, tool, hp, ToolOs::OpenBsd);
#elif defined(__NetBSD__)
auto data = get_raw_tool_data(tool_data_table, tool, hp, ToolOs::NetBsd);
#elif defined(__DragonFly__)
auto data = get_raw_tool_data(tool_data_table, tool, hp, ToolOs::DragonFly);
#elif defined(__SVR4) && defined(__sun)
auto data = get_raw_tool_data(tool_data_table, tool, hp, ToolOs::Solaris);
#else
Expand Down
Loading