Skip to content

Commit

Permalink
8257895: Allow building of JavaFX media libs for Apple Silicon
Browse files Browse the repository at this point in the history
Co-authored-by: Johan Vos <jvos@openjdk.org>
Reviewed-by: jvos, kcr
  • Loading branch information
Alexander Matveev and Johan Vos committed Mar 15, 2021
1 parent 92d6232 commit 8adbc67
Show file tree
Hide file tree
Showing 19 changed files with 3,572 additions and 24 deletions.
7 changes: 5 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,9 @@ if (IS_STATIC_BUILD && IS_COMPILE_MEDIA) {
throw new GradleException("Can not have COMPILE_MEDIA when STATIC_BUILD is enabled");
}

// By default, target architecture = host architecture, but we allow different ones.
defineProperty("TARGET_ARCH", OS_ARCH)

// BUILD_TOOLS_DOWNLOAD_SCRIPT specifies a path of a gradle script which downloads
// required build tools.
defineProperty("BUILD_TOOLS_DOWNLOAD_SCRIPT", "")
Expand Down Expand Up @@ -3295,13 +3298,13 @@ project(":media") {
doLast {
exec {
commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/libffi")
args("OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", "BASE_NAME=ffi")
args("OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", "BASE_NAME=ffi", "ARCH=$TARGET_ARCH")
args ("CC=${mediaProperties.compiler}", "LINKER=${mediaProperties.linker}", "AR=${mediaProperties.ar}")
}

exec {
commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/glib-lite")
args("OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", "BASE_NAME=glib-lite")
args("OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", "BASE_NAME=glib-lite", "ARCH=$TARGET_ARCH")
args ("CC=${mediaProperties.compiler}", "LINKER=${mediaProperties.linker}")
}
}
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/mac.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def commonParams = [
"-arch", "$TARGET_ARCH"]

if (hasProperty('TARGET_ARCH')) {
commonParams = ["-target", "${TARGET_ARCH}-apple-macos-11", commonParams]
commonParams = ["-target", "${TARGET_ARCH}-apple-macos-11", commonParams].flatten()
}

def ccBaseFlags = [
Expand Down

1 comment on commit 8adbc67

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.