# HG changeset patch # User ddehaven # Date 1414705354 25200 # Thu Oct 30 14:42:34 2014 -0700 # Node ID 5fad156021101a29f0fbe22a7ece2c6a85ce0c05 # Parent 25fb20621efd109df9ac40d583a91c53ce252bd9 RT-39238: [media] Mac native platform code doesn't compile with parfait compilers Summary: Added check to Makefile and changed compilers when running parfait Reviewed-by: kcr diff --git a/build.gradle b/build.gradle --- a/build.gradle +++ b/build.gradle @@ -2224,6 +2224,8 @@ def nativeOutputDir = file("${buildDir}/native/${t.name}") def projectDir = t.name.startsWith("arm") ? "linux" : t.name def mediaProperties = targetProperties.media + // Makefile for OSX needs to know if we're building for parfait + def compileParfait = IS_COMPILE_PARFAIT ? "true" : "false" def buildNative = task("build${t.capital}Native", dependsOn: [generateHeaders, generateMediaErrorHeader]) { enabled = targetProperties.compileMediaNative @@ -2235,7 +2237,8 @@ exec { commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/jfxmedia/projects/${projectDir}") args("JAVA_HOME=${JDK_HOME}", "GENERATED_HEADERS_DIR=${generatedHeadersDir}", - "OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", "BASE_NAME=jfxmedia") + "OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", "BASE_NAME=jfxmedia", + "COMPILE_PARFAIT=${compileParfait}") if (t.name == "win") { environment(WINDOWS_NATIVE_COMPILE_ENVIRONMENT) diff --git a/modules/media/src/main/native/jfxmedia/projects/mac/Makefile b/modules/media/src/main/native/jfxmedia/projects/mac/Makefile --- a/modules/media/src/main/native/jfxmedia/projects/mac/Makefile +++ b/modules/media/src/main/native/jfxmedia/projects/mac/Makefile @@ -192,13 +192,19 @@ # The AVFoundation code uses ARC which is only supported by the clang compiler, so we'll # force the use of clang for this module. -# We use --sdk macosx to force it to use the latest macosx SDK, which should be 10.8 or later -# add -l to show the full command line used to invoke clang++ -AVF_CPP = xcrun -l $(AVF_XCRUN_FLAGS) clang++ +ifeq ($(COMPILE_PARFAIT), true) + # call xcrun so we wrap the correct clang++ executable + CLANG_PATH = $(shell xcrun -find clang++) + AVF_CPP = parfait-clang++ --nativecxx "$(CLANG_PATH)" +else + # add -l to show the full command line used to invoke clang++ (for debugging purposes) + AVF_CPP = xcrun -l $(AVF_XCRUN_FLAGS) clang++ +endif AVF_OBJBASE = $(OBJBASE_DIR)/avf # We need a full path to the right SDK +# We use --sdk macosx to force it to use the latest macosx SDK, which should be 10.8 or later AVF_SYSROOT = $(shell xcodebuild -sdk macosx -version | grep '^Path: ' | sed 's/Path: //') # we have to remove -mmacosx-version-min=% from CFLAGS and LDFLAGS and set it to