GP-4235: Adding the means to build and find native components on FreeBSD

This commit is contained in:
Ryan Kurtz
2024-01-16 08:26:46 -05:00
parent 1281fb979b
commit d16747cf6c
8 changed files with 42 additions and 7 deletions
+2
View File
@@ -81,6 +81,7 @@ model {
targetPlatform "linux_arm_64"
targetPlatform "mac_x86_64"
targetPlatform "mac_arm_64"
targetPlatform "freebsd_x86_64"
sources {
c {
source {
@@ -102,6 +103,7 @@ model {
targetPlatform "linux_arm_64"
targetPlatform "mac_x86_64"
targetPlatform "mac_arm_64"
targetPlatform "freebsd_x86_64"
sources {
c {
source {
+5
View File
@@ -52,6 +52,11 @@ model {
}
}
}
if (isCurrentFreeBSD()) {
gcc(Gcc) {
target("freebsd_x86_64")
}
}
if (isCurrentWindows() && VISUAL_STUDIO_INSTALL_DIR) {
// specify installDir because Gradle doesn't find VS Build Tools.
// See https://github.com/gradle/gradle-native/issues/617#issuecomment-575735288
+19 -1
View File
@@ -24,7 +24,8 @@ project.ext.PLATFORMS = [
[name: "linux_x86_64", os: "linux", arch: "x86_64"],
[name: "linux_arm_64", os: "linux", arch: "arm64"],
[name: "mac_x86_64", os: "osx", arch: "x86_64"],
[name: "mac_arm_64", os: "osx", arch: "arm64"]
[name: "mac_arm_64", os: "osx", arch: "arm64"],
[name: "freebsd_x86_64", os: "freebsd", arch: "x86_64"]
]
/*********************************************************************************
@@ -51,6 +52,9 @@ ext.getCurrentPlatformName = {
case ~/Mac OS X.*/:
os = "mac"
break
case ~/FreeBSD.*/:
os = "freebsd"
break
default:
throw new GradleException("Unrecognized platform operating system: $os")
}
@@ -112,6 +116,20 @@ ext.isCurrentMac = {
return isMac(getCurrentPlatformName())
}
/*********************************************************************************
* Returns true if the given platform is FreeBSD.
*********************************************************************************/
ext.isFreeBSD = { platform_name ->
return platform_name.startsWith("freebsd")
}
/*********************************************************************************
* Returns true if the current platform is FreeBSD.
*********************************************************************************/
ext.isCurrentFreeBSD = {
return isFreeBSD(getCurrentPlatformName())
}
/*********************************************************************************
* Returns true if the given platform is Windows.
*********************************************************************************/