view buildSrc/mac.gradle @ 8148:6b242a49e749

RT-34893: [Media] Use of QuickTime prevents Mac AppStore Submission Summary: Added new media platform module which uses AVFoundation instead of QTKit Reviewed-by: almatvee, stayer, kcr, flar
author ddehaven
date Mon, 06 Oct 2014 09:32:41 -0700
parents bea785e79ae4
children bc5276da2cb9
line wrap: on
line source
/*
 * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.  Oracle designates this
 * particular file as subject to the "Classpath" exception as provided
 * by Oracle in the LICENSE file that accompanied this code.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 * or visit www.oracle.com if you need additional information or have any
 * questions.
 */

ext.MAC = [:]

MAC.canBuild = IS_MAC && IS_64
if (!MAC.canBuild) return;

// All desktop related packages should be built
MAC.compileSwing = true;
MAC.compileSWT = true;
MAC.compileFXPackager = true;
MAC.compileDesignTime = true;

MAC.includeNull3d = true

// Lambda for naming the generated libs
MAC.library = { name -> return "lib${name}.dylib" as String }

MAC.libDest = "lib"

// Define settings for Mac compilation. This is much easier than Windows because we know what version we're
// compiling against and Mac always puts it in the same place. In extreme cases you can provide your own
// properties in your home dir to override these settings or pass them on the command line via -P
defineProperty("MACOSX_MIN_VERSION", "10.7");
defineProperty("MACOSX_SDK_PATH", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${MACOSX_MIN_VERSION}.sdk");

def commonParams = [
        "-mmacosx-version-min=$MACOSX_MIN_VERSION",
        "-isysroot", "$MACOSX_SDK_PATH",
        "-arch", "x86_64"]

def ccBaseFlags = [
        commonParams,
        "-I$JDK_HOME/include",
        "-I$JDK_HOME/include/darwin"].flatten()


def ccFlags = [
        ccBaseFlags,
        "-std=c99",
        "-c",
        IS_DEBUG_NATIVE ? "-DDEBUG" : ["-O3", "-DNDEBUG"]].flatten()

def linkFlags = [
        commonParams,
        "-framework", "AppKit",
        "-framework", "ApplicationServices",
        "-framework", "OpenGL",
        "-framework", "QuartzCore",
        "-framework", "Security",
        "-dynamiclib", "-lobjc"].flatten();


def compiler = IS_COMPILE_PARFAIT ? "parfait-gcc" : "gcc";
def linker = IS_COMPILE_PARFAIT ? "parfait-g++" : "g++";

MAC.glass = [:]
MAC.glass.javahInclude = [
    "com/sun/glass/events/**",
    "com/sun/glass/ui/*",
    "com/sun/glass/ui/mac/*"]
MAC.glass.nativeSource = file("modules/graphics/src/main/native-glass/mac")
MAC.glass.compiler = compiler
MAC.glass.ccFlags = [ccFlags].flatten()
MAC.glass.linker = linker
MAC.glass.linkFlags = [linkFlags].flatten()
MAC.glass.lib = "glass"

MAC.decora = [:]
MAC.decora.compiler = compiler
MAC.decora.ccFlags = ["-O1", "-ffast-math", "-c", ccBaseFlags].flatten()
MAC.decora.linker = linker
MAC.decora.linkFlags = ["-dynamiclib", commonParams].flatten()
MAC.decora.lib = "decora_sse"

MAC.prism = [:]
MAC.prism.javahInclude = ["com/sun/prism/impl/**/*", "com/sun/prism/PresentableState*"]
MAC.prism.nativeSource = file("modules/graphics/src/main/native-prism")
MAC.prism.compiler = compiler
MAC.prism.ccFlags = ["-O3", "-DINLINE=inline", "-c", ccBaseFlags].flatten()
MAC.prism.linker = linker
MAC.prism.linkFlags = ["-dynamiclib", commonParams].flatten()
MAC.prism.lib = "prism_common"

MAC.prismSW = [:]
MAC.prismSW.javahInclude = ["com/sun/pisces/**/*"]
MAC.prismSW.nativeSource = file("modules/graphics/src/main/native-prism-sw")
MAC.prismSW.compiler = compiler
MAC.prismSW.ccFlags = [MAC.prism.ccFlags].flatten()
MAC.prismSW.linker = linker
MAC.prismSW.linkFlags = [MAC.prism.linkFlags].flatten()
MAC.prismSW.lib = "prism_sw"

MAC.launcher = [:]
MAC.launcher.compiler = compiler
MAC.launcher.ccFlags = [
        "-std=c99",
        ccBaseFlags,
        "-framework", "Cocoa",
        IS_DEBUG_NATIVE ? ["-DDEBUG", "-O0"] : ["-O3", "-DNDEBUG"]].flatten()
MAC.launcher.linker = linker
MAC.launcher.linkFlags = ["-ldl"]

MAC.launcherlibrary = [:]
MAC.launcherlibrary.compiler = compiler
MAC.launcherlibrary.ccFlags = [
//        "-std=c++0x",
        "-c",
        ccBaseFlags,
        IS_DEBUG_NATIVE ? ["-DDEBUG", "-O0"] : ["-O3", "-DNDEBUG"]].flatten()
MAC.launcherlibrary.linker = linker
MAC.launcherlibrary.linkFlags = ["-ldl", "-dynamiclib",
        "-framework", "Cocoa",
        "-stdlib=libstdc++"]

MAC.iio = [:]
MAC.iio.javahInclude = ["com/sun/javafx/iio/**/*"]
MAC.iio.nativeSource = [
    file("modules/graphics/src/main/native-iio"),
    file("modules/graphics/src/main/native-iio/libjpeg7")]
MAC.iio.compiler = compiler
MAC.iio.ccFlags = [ccFlags].flatten()
MAC.iio.linker = linker
MAC.iio.linkFlags = [linkFlags].flatten()
MAC.iio.lib = "javafx_iio"

MAC.prismES2 = [:]
MAC.prismES2.javahInclude = ["com/sun/prism/es2/**/*"]
MAC.prismES2.nativeSource = [
    file("modules/graphics/src/main/native-prism-es2"),
    file("modules/graphics/src/main/native-prism-es2/GL"),
    file("modules/graphics/src/main/native-prism-es2/macosx")
]
MAC.prismES2.compiler = compiler
MAC.prismES2.ccFlags = ["-DMACOSX", ccFlags].flatten()
MAC.prismES2.linker = linker
MAC.prismES2.linkFlags = [linkFlags].flatten()
MAC.prismES2.lib = "prism_es2"

def closedDir = file("$projectDir/../rt-closed")
MAC.font = [:]
MAC.font.javahInclude = [
        "com/sun/javafx/font/**/*",
        "com/sun/javafx/text/**/*"]
MAC.font.nativeSource = [file("modules/graphics/src/main/native-font")]
MAC.font.compiler = compiler
MAC.font.ccFlags = ["-DJFXFONT_PLUS", ccFlags].flatten()
MAC.font.linker = linker
MAC.font.linkFlags = [linkFlags].flatten()
MAC.font.lib = "javafx_font"

MAC.fontT2K = [:]
MAC.fontT2K.javahInclude = ["com/sun/javafx/font/t2k/**/*"]
MAC.fontT2K.nativeSource = [
        file("$closedDir/javafx-font-t2k-native/src"),
        file("$closedDir/javafx-font-t2k-native/src/layout")]
MAC.fontT2K.compiler = compiler
MAC.fontT2K.ccFlags = ["-DJFXFONT_PLUS", "-DLE_STANDALONE", ccFlags].flatten()
MAC.fontT2K.linker = linker
MAC.fontT2K.linkFlags = [linkFlags].flatten()
MAC.fontT2K.lib = "javafx_font_t2k"

MAC.media = [:]
MAC.media.compiler = compiler
MAC.media.linker = linker
MAC.media.lib = "libtool"