diff --git a/docs/vcpkg-tools.schema.json b/docs/vcpkg-tools.schema.json index c34cf4205f..bc8e3e0d5a 100644 --- a/docs/vcpkg-tools.schema.json +++ b/docs/vcpkg-tools.schema.json @@ -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", diff --git a/include/vcpkg/tools.test.h b/include/vcpkg/tools.test.h index 3fe16649d0..f24c0ab4ce 100644 --- a/include/vcpkg/tools.test.h +++ b/include/vcpkg/tools.test.h @@ -48,6 +48,7 @@ namespace vcpkg FreeBsd, OpenBsd, NetBsd, + DragonFly, Solaris, }; diff --git a/src/vcpkg-test/tools.cpp b/src/vcpkg-test/tools.cpp index 204684c07d..3f2c181475 100644 --- a/src/vcpkg-test/tools.cpp +++ b/src/vcpkg-test/tools.cpp @@ -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"( { diff --git a/src/vcpkg.cpp b/src/vcpkg.cpp index 0dc64e15ea..bd214ac0cf 100644 --- a/src/vcpkg.cpp +++ b/src/vcpkg.cpp @@ -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 #endif diff --git a/src/vcpkg/base/system.cpp b/src/vcpkg/base/system.cpp index acd759a1dc..e3d4384369 100644 --- a/src/vcpkg/base/system.cpp +++ b/src/vcpkg/base/system.cpp @@ -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__) diff --git a/src/vcpkg/base/system.mac.cpp b/src/vcpkg/base/system.mac.cpp index ad0fd28769..44dfc97345 100644 --- a/src/vcpkg/base/system.mac.cpp +++ b/src/vcpkg/base/system.mac.cpp @@ -9,7 +9,7 @@ #if !defined(_WIN32) #include -#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) +#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) #include #include @@ -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. @@ -199,7 +200,8 @@ namespace vcpkg auto address = reinterpret_cast(interface->ifa_addr); if (address->sll_halen != MAC_BYTES_LENGTH) continue; auto mac_bytes = Span(reinterpret_cast(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(interface->ifa_addr); if (address->sdl_alen != MAC_BYTES_LENGTH) continue; // The macro LLADDR() returns the start of the link-layer network address. diff --git a/src/vcpkg/base/system.process.cpp b/src/vcpkg/base/system.process.cpp index a248372ef3..cc975dfa1a 100644 --- a/src/vcpkg/base/system.process.cpp +++ b/src/vcpkg/base/system.process.cpp @@ -19,7 +19,7 @@ extern char** environ; #include #endif -#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) +#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) extern char** environ; #include #include @@ -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."); diff --git a/src/vcpkg/commands.build.cpp b/src/vcpkg/commands.build.cpp index c6ce81fcfd..2a1c3a2d13 100644 --- a/src/vcpkg/commands.build.cpp +++ b/src/vcpkg/commands.build.cpp @@ -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"; diff --git a/src/vcpkg/platform-expression.cpp b/src/vcpkg/platform-expression.cpp index 92a3b7b855..2410f96ec1 100644 --- a/src/vcpkg/platform-expression.cpp +++ b/src/vcpkg/platform-expression.cpp @@ -30,6 +30,7 @@ namespace vcpkg::PlatformExpression freebsd, openbsd, netbsd, + dragonfly, bsd, solaris, osx, @@ -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}, @@ -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: diff --git a/src/vcpkg/tools.cpp b/src/vcpkg/tools.cpp index a2d405f0d8..e46898f9eb 100644 --- a/src/vcpkg/tools.cpp +++ b/src/vcpkg/tools.cpp @@ -39,6 +39,7 @@ namespace {"freebsd", ToolOs::FreeBsd}, {"openbsd", ToolOs::OpenBsd}, {"netbsd", ToolOs::NetBsd}, + {"dragonfly", ToolOs::DragonFly}, {"solaris", ToolOs::Solaris}, }; } @@ -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