< prev index next >

./build.gradle

Print this page
rev 8274 : 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


2207             def srcRoot = (sourcepath.toArray())[0];
2208 
2209             mkdir generatedHeadersDir;
2210 
2211             exec {
2212                 commandLine("$JAVA", "-Djava.ext.dirs=", "-classpath", "${classpath.asPath}");
2213                 args("headergen.HeaderGen", "$headerpath", "$srcRoot");
2214             }
2215         }
2216     }
2217 
2218     task buildNativeTargets {
2219         enabled = IS_COMPILE_MEDIA
2220     }
2221     
2222     compileTargets { t->        
2223         def targetProperties = project.rootProject.ext[t.upper]
2224         def nativeOutputDir = file("${buildDir}/native/${t.name}")
2225         def projectDir = t.name.startsWith("arm") ? "linux" : t.name
2226         def mediaProperties = targetProperties.media


2227         
2228         def buildNative = task("build${t.capital}Native", dependsOn: [generateHeaders, generateMediaErrorHeader]) {
2229             enabled = targetProperties.compileMediaNative
2230             if (!targetProperties.compileMediaNative) {
2231                 println("Not compiling native Media for ${t.name} per configuration request");
2232             } 
2233 
2234             doLast {
2235                 exec {
2236                     commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/jfxmedia/projects/${projectDir}")
2237                     args("JAVA_HOME=${JDK_HOME}", "GENERATED_HEADERS_DIR=${generatedHeadersDir}",
2238                          "OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", "BASE_NAME=jfxmedia")

2239 
2240                     if (t.name == "win") {
2241                         environment(WINDOWS_NATIVE_COMPILE_ENVIRONMENT)
2242                         args(IS_64 ? "ARCH=x64" : "ARCH=x32", "RESOURCE=${nativeOutputDir}/${buildType}/${WIN.media.jfxmediaRcFile}")
2243                     } else {
2244                         args ("CC=${mediaProperties.compiler}", "LINK=${mediaProperties.linker}", "LIB=${mediaProperties.lib}")
2245 
2246                         if (t.name.startsWith("arm")) {
2247                             args("EXTRA_CFLAGS=${mediaProperties.extra_cflags}", "EXTRA_LDFLAGS=${mediaProperties.extra_ldflags}")
2248                         } else {
2249                             args("HOST_COMPILE=1")
2250                         }
2251                     }
2252                 }
2253             }
2254         }        
2255         
2256         // check for the property disable${name} = true
2257         def boolean disabled = targetProperties.containsKey('disableMedia') ? targetProperties.get('disableMedia') : false
2258         if (!disabled) {




2207             def srcRoot = (sourcepath.toArray())[0];
2208 
2209             mkdir generatedHeadersDir;
2210 
2211             exec {
2212                 commandLine("$JAVA", "-Djava.ext.dirs=", "-classpath", "${classpath.asPath}");
2213                 args("headergen.HeaderGen", "$headerpath", "$srcRoot");
2214             }
2215         }
2216     }
2217 
2218     task buildNativeTargets {
2219         enabled = IS_COMPILE_MEDIA
2220     }
2221     
2222     compileTargets { t->        
2223         def targetProperties = project.rootProject.ext[t.upper]
2224         def nativeOutputDir = file("${buildDir}/native/${t.name}")
2225         def projectDir = t.name.startsWith("arm") ? "linux" : t.name
2226         def mediaProperties = targetProperties.media
2227         // Makefile for OSX needs to know if we're building for parfait
2228         def compileParfait = IS_COMPILE_PARFAIT ? "true" : "false"
2229         
2230         def buildNative = task("build${t.capital}Native", dependsOn: [generateHeaders, generateMediaErrorHeader]) {
2231             enabled = targetProperties.compileMediaNative
2232             if (!targetProperties.compileMediaNative) {
2233                 println("Not compiling native Media for ${t.name} per configuration request");
2234             } 
2235 
2236             doLast {
2237                 exec {
2238                     commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/jfxmedia/projects/${projectDir}")
2239                     args("JAVA_HOME=${JDK_HOME}", "GENERATED_HEADERS_DIR=${generatedHeadersDir}",
2240                          "OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", "BASE_NAME=jfxmedia",
2241                          "COMPILE_PARFAIT=${compileParfait}")
2242 
2243                     if (t.name == "win") {
2244                         environment(WINDOWS_NATIVE_COMPILE_ENVIRONMENT)
2245                         args(IS_64 ? "ARCH=x64" : "ARCH=x32", "RESOURCE=${nativeOutputDir}/${buildType}/${WIN.media.jfxmediaRcFile}")
2246                     } else {
2247                         args ("CC=${mediaProperties.compiler}", "LINK=${mediaProperties.linker}", "LIB=${mediaProperties.lib}")
2248 
2249                         if (t.name.startsWith("arm")) {
2250                             args("EXTRA_CFLAGS=${mediaProperties.extra_cflags}", "EXTRA_LDFLAGS=${mediaProperties.extra_ldflags}")
2251                         } else {
2252                             args("HOST_COMPILE=1")
2253                         }
2254                     }
2255                 }
2256             }
2257         }        
2258         
2259         // check for the property disable${name} = true
2260         def boolean disabled = targetProperties.containsKey('disableMedia') ? targetProperties.get('disableMedia') : false
2261         if (!disabled) {


< prev index next >