From c2d6e43ecbefc0da8edc5d7793617c233fe227a6 Mon Sep 17 00:00:00 2001 From: Arunprasad Rajkumar Date: Tue, 13 Nov 2018 23:25:02 +0530 Subject: [PATCH 1/3] Provide an infrastruture to supply custom toolchain paths to FX build system --- build.gradle | 39 +++++++------- buildSrc/linux.gradle | 29 +++++++---- buildSrc/mac.gradle | 20 ++++++-- buildSrc/win.gradle | 51 +++++++++++-------- .../native/Source/WebCore/PlatformJava.cmake | 2 +- .../native/Source/WebCore/WebCoreMacros.cmake | 10 +++- .../bindings/scripts/generate-bindings-all.pl | 9 +++- .../bindings/scripts/generate-bindings.pl | 14 ++++- .../main/native/Tools/Scripts/webkitdirs.pm | 5 +- 9 files changed, 116 insertions(+), 63 deletions(-) diff --git a/build.gradle b/build.gradle index a8f06371a9..88105bf30f 100644 --- a/build.gradle +++ b/build.gradle @@ -396,6 +396,10 @@ ext.IS_COMPILE_HARFBUZZ = Boolean.parseBoolean(COMPILE_HARFBUZZ) defineProperty("COMPILE_PARFAIT", "false") ext.IS_COMPILE_PARFAIT = Boolean.parseBoolean(COMPILE_PARFAIT) +// BUILD_TOOLS_DOWNLOAD_SCRIPT specifies a path of a gradle script which downloads +// required build tools. +defineProperty("BUILD_TOOLS_DOWNLOAD_SCRIPT", "") + // Define the SWT.jar that we are going to have to download during the build process based // on what platform we are compiling from (not based on our target). ext.SWT_FILE_NAME = IS_MAC ? "org.eclipse.swt.cocoa.macosx.x86_64_3.105.3.v20170228-0512" : @@ -687,7 +691,7 @@ void fetchExternalTools(String configName, List packages, File destdir, boolean def String basename = pkgname.substring(0,pkgname.lastIndexOf(".")) def File pkgdir = file("$destdir/$basename") - if (pkgname.endsWith(".tgz")) { + if (pkgname.endsWith(".tgz") || pkgname.endsWith("tar.gz")) { if (IS_LINUX || IS_MAC) { // use native tar to support symlinks pkgdir.mkdirs() @@ -759,7 +763,8 @@ void ant(String conf, // platform configuration "INCLUDE" : WINDOWS_VS_INCLUDE, "LIB" : WINDOWS_VS_LIB, "LIBPATH" : WINDOWS_VS_LIBPATH, - "DXSDK_DIR" : WINDOWS_DXSDK_DIR + "DXSDK_DIR" : WINDOWS_DXSDK_DIR, + "PATH" : WINDOWS_VS_PATH ]); commandLine "cmd", "/c", ant, "-Dbuild.compiler=javac1.7" } else { @@ -1080,6 +1085,11 @@ void commonModuleSetup(Project p, List moduleChain) { } } +if (BUILD_TOOLS_DOWNLOAD_SCRIPT != "") { + println "Include build tools download script:${BUILD_TOOLS_DOWNLOAD_SCRIPT}" + apply from: BUILD_TOOLS_DOWNLOAD_SCRIPT +} + // Now we need to define the native compilation tasks. The set of parameters to // native compilation depends on the target platform (and also to some extent what platform // you are compiling on). These settings are contained in various gradle files @@ -3190,26 +3200,14 @@ project(":web") { exec { workingDir("$webkitOutputDir") def cmakeArgs = "-DENABLE_TOOLS=1" + cmakeArgs = " $cmakeArgs -DCMAKE_C_COMPILER=${webkitProperties.compiler}" if (t.name == "win") { - String parfaitPath = IS_COMPILE_PARFAIT ? System.getenv().get("PARFAIT_PATH") + ";" : ""; - Map environmentSettings = new HashMap(WINDOWS_NATIVE_COMPILE_ENVIRONMENT) - environmentSettings["PATH"] = parfaitPath + "$WINDOWS_VS_PATH" - /* To build with ICU: - 1. Download http://javaweb.us.oracle.com/jcg/fx-webrevs/RT-17164/WebKitLibrariesICU.zip - and unzip it to WebKitLibraries folder. - 2. Copy DLLs from - WebKitLibrariesICU.zip\WebKitLibraries\import\runtime - to %windir%\system32 - 3. Uncomment the line below - */ - // args("--icu-unicode") - // To enable ninja build on Windows - environment(WINDOWS_NATIVE_COMPILE_ENVIRONMENT + ['CC' : 'cl', 'CXX' : 'cl']) + environment(WINDOWS_NATIVE_COMPILE_ENVIRONMENT) } else if (t.name == "mac") { - cmakeArgs = "-DCMAKE_OSX_DEPLOYMENT_TARGET=$MACOSX_MIN_VERSION -DCMAKE_OSX_SYSROOT=$MACOSX_SDK_PATH" + cmakeArgs = " $cmakeArgs -DCMAKE_OSX_DEPLOYMENT_TARGET=$MACOSX_MIN_VERSION -DCMAKE_OSX_SYSROOT=$MACOSX_SDK_PATH" } else if (t.name == "linux") { - cmakeArgs = "-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_C_COMPILER=${webkitProperties.compiler}" + cmakeArgs = " $cmakeArgs -DCMAKE_SYSTEM_NAME=Linux" if (IS_64) { cmakeArgs = "$cmakeArgs -DCMAKE_SYSTEM_PROCESSOR=x86_64" } else { @@ -3230,9 +3228,14 @@ project(":web") { environment([ "COMPILE_PARFAIT" : "true" ]) + environment "PATH", System.env.PARFAIT_PATH + File.pathSeparator + environment.PATH cmakeArgs = "-DCMAKE_C_COMPILER=parfait-gcc -DCMAKE_CXX_COMPILER=parfait-g++" } + if (project.hasProperty('toolsPath')) { + environment "PATH", toolsPath + File.pathSeparator + environment.PATH + } + environment([ "JAVA_HOME" : JDK_HOME, "WEBKIT_OUTPUTDIR" : webkitOutputDir, diff --git a/buildSrc/linux.gradle b/buildSrc/linux.gradle index b9a28ce777..565bb4d387 100644 --- a/buildSrc/linux.gradle +++ b/buildSrc/linux.gradle @@ -62,6 +62,13 @@ if (IS_DEBUG_NATIVE) { linkFlags += "-g" } +def toolchainDir +if (hasProperty('toolchainDir')) { + toolchainDir = ext.toolchainDir + "/" +} else { + toolchainDir = "" +} + def gtk2CCFlags = [ ]; def gtk3CCFlags = [ "-Wno-deprecated-declarations" ]; def gtk2LinkFlags = [ ]; @@ -73,14 +80,14 @@ setupTools("linux_gtk2", { propFile -> ByteArrayOutputStream results1 = new ByteArrayOutputStream(); exec { - commandLine("pkg-config", "--cflags", "gtk+-2.0", "gthread-2.0", "xtst") + commandLine("${toolchainDir}pkg-config", "--cflags", "gtk+-2.0", "gthread-2.0", "xtst") setStandardOutput(results1); } propFile << "cflagsGTK2=" << results1.toString().trim() << "\n"; ByteArrayOutputStream results3 = new ByteArrayOutputStream(); exec { - commandLine("pkg-config", "--libs", "gtk+-2.0", "gthread-2.0", "xtst") + commandLine("${toolchainDir}pkg-config", "--libs", "gtk+-2.0", "gthread-2.0", "xtst") setStandardOutput(results3); } propFile << "libsGTK2=" << results3.toString().trim() << "\n"; @@ -101,7 +108,7 @@ setupTools("linux_gtk3", { propFile -> ByteArrayOutputStream results2 = new ByteArrayOutputStream(); exec { - commandLine("pkg-config", "--cflags", "gtk+-3.0", "gthread-2.0", "xtst") + commandLine("${toolchainDir}pkg-config", "--cflags", "gtk+-3.0", "gthread-2.0", "xtst") setStandardOutput(results2); ignoreExitValue(true) } @@ -109,7 +116,7 @@ setupTools("linux_gtk3", ByteArrayOutputStream results4 = new ByteArrayOutputStream(); exec { - commandLine("pkg-config", "--libs", "gtk+-3.0", "gthread-2.0", "xtst") + commandLine("${toolchainDir}pkg-config", "--libs", "gtk+-3.0", "gthread-2.0", "xtst") setStandardOutput(results4); ignoreExitValue(true) } @@ -135,14 +142,14 @@ setupTools("linux_pango_tools", { propFile -> ByteArrayOutputStream results = new ByteArrayOutputStream(); exec { - commandLine "pkg-config", "--cflags", "pangoft2" + commandLine "${toolchainDir}pkg-config", "--cflags", "pangoft2" standardOutput = results } propFile << "cflags=" << results.toString().trim() << "\n"; results = new ByteArrayOutputStream(); exec { - commandLine "pkg-config", "--libs", "pangoft2" + commandLine "${toolchainDir}pkg-config", "--libs", "pangoft2" standardOutput = results } propFile << "libs=" << results.toString().trim(); @@ -166,14 +173,14 @@ setupTools("linux_freetype_tools", { propFile -> ByteArrayOutputStream results = new ByteArrayOutputStream(); exec { - commandLine "pkg-config", "--cflags", "freetype2" + commandLine "${toolchainDir}pkg-config", "--cflags", "freetype2" standardOutput = results } propFile << "cflags=" << results.toString().trim() << "\n"; results = new ByteArrayOutputStream(); exec { - commandLine "pkg-config", "--libs", "freetype2" + commandLine "${toolchainDir}pkg-config", "--libs", "freetype2" standardOutput = results } propFile << "libs=" << results.toString().trim(); @@ -190,8 +197,8 @@ setupTools("linux_freetype_tools", } ) -def compiler = IS_COMPILE_PARFAIT ? "parfait-gcc" : "gcc"; -def linker = IS_COMPILE_PARFAIT ? "parfait-g++" : "g++"; +def compiler = IS_COMPILE_PARFAIT ? "parfait-gcc" : "${toolchainDir}gcc"; +def linker = IS_COMPILE_PARFAIT ? "parfait-g++" : "${toolchainDir}g++"; LINUX.glass = [:] LINUX.glass.variants = ["glass", "glassgtk2"] @@ -307,7 +314,7 @@ LINUX.fontPango.lib = "javafx_font_pango" LINUX.media = [:] LINUX.media.compiler = compiler LINUX.media.linker = linker -LINUX.media.ar = "ar" +LINUX.media.ar = "${toolchainDir}ar" LINUX.webkit = [:] LINUX.webkit.compiler = compiler diff --git a/buildSrc/mac.gradle b/buildSrc/mac.gradle index ecc5bbea5b..f740469d9e 100644 --- a/buildSrc/mac.gradle +++ b/buildSrc/mac.gradle @@ -56,7 +56,9 @@ defineProperty("MACOSX_MIN_VERSION", "10.10"); setupTools("mac_tools", { propFile -> propFile << "" - if (!file(defaultSdkPath).isDirectory()) { + if (project.hasProperty('setupMacTools')) { + setupMacTools(propFile) + } else if (!file(defaultSdkPath).isDirectory()) { // Get list of all macosx sdks ByteArrayOutputStream results = new ByteArrayOutputStream(); exec { @@ -126,9 +128,15 @@ def linkFlags = [ "-framework", "Security", "-dynamiclib", "-lobjc"].flatten(); +def toolchainDir +if (hasProperty('toolchainDir')) { + toolchainDir = ext.toolchainDir + "/" +} else { + toolchainDir = "" +} -def compiler = IS_COMPILE_PARFAIT ? "parfait-clang" : "clang"; -def linker = IS_COMPILE_PARFAIT ? "parfait-clang++" : "clang++"; +def compiler = IS_COMPILE_PARFAIT ? "parfait-clang" : "${toolchainDir}clang"; +def linker = IS_COMPILE_PARFAIT ? "parfait-clang++" : "${toolchainDir}clang++"; MAC.glass = [:] MAC.glass.javahInclude = [ @@ -208,4 +216,8 @@ MAC.media.compiler = "${compiler} ${ccBaseFlags.join(" ")}" //MAC.media.ccFlags = ccBaseFlags MAC.media.linker = "${linker} ${commonParams.join(" ")}" //MAC.media.linkFlags = commonParams -MAC.media.ar = "libtool" +MAC.media.ar = "${toolchainDir}libtool" + +MAC.webkit = [:] +MAC.webkit.compiler = compiler +MAC.webkit.linker = linker diff --git a/buildSrc/win.gradle b/buildSrc/win.gradle index 2be483aad6..443700789e 100644 --- a/buildSrc/win.gradle +++ b/buildSrc/win.gradle @@ -41,26 +41,30 @@ WIN.modLibDest = "lib" setupTools("windows_tools", { propFile -> - // Create the properties file - ByteArrayOutputStream results = new ByteArrayOutputStream(); - String winsdkDir = System.getenv().get("WINSDK_DIR"); - exec({ - environment([ - "WINSDKPATH" : winsdkDir == null ? "" : winsdkDir, - "CONF" : "/$CONF", // TODO does this mean the generated properties must be reset when in a different configuration? - "VCARCH" : IS_64 ? "amd64" : "x86", - "SDKARCH" : IS_64 ? "/x64" : "/x86", - ]); - commandLine("cmd", "/q", "/c", "buildSrc\\genVSproperties.bat"); - setStandardOutput(results); - }); - BufferedReader reader = new BufferedReader(new StringReader(results.toString().trim())); - reader.readLine(); - reader.readLine(); - String line; - while ((line = reader.readLine()) != null && !line.startsWith("######")) { - line = line.replace("\\", "/").replace("/@@ENDOFLINE@@", "").replace("@@ENDOFLINE@@", "").replace("//", "/").replace("windows.vs.", "WINDOWS_VS_"); - propFile << line << "\r\n"; + if (project.hasProperty('setupWinTools')) { + setupWinTools(propFile) + } else { + // Create the properties file + ByteArrayOutputStream results = new ByteArrayOutputStream(); + String winsdkDir = System.getenv().get("WINSDK_DIR"); + exec({ + environment([ + "WINSDKPATH" : winsdkDir == null ? "" : winsdkDir, + "CONF" : "/$CONF", // TODO does this mean the generated properties must be reset when in a different configuration? + "VCARCH" : IS_64 ? "amd64" : "x86", + "SDKARCH" : IS_64 ? "/x64" : "/x86", + ]); + commandLine("cmd", "/q", "/c", "buildSrc\\genVSproperties.bat"); + setStandardOutput(results); + }); + BufferedReader reader = new BufferedReader(new StringReader(results.toString().trim())); + reader.readLine(); + reader.readLine(); + String line; + while ((line = reader.readLine()) != null && !line.startsWith("######")) { + line = line.replace("\\", "/").replace("/@@ENDOFLINE@@", "").replace("@@ENDOFLINE@@", "").replace("//", "/").replace("windows.vs.", "WINDOWS_VS_"); + propFile << line << "\r\n"; + } } }, { properties -> @@ -133,7 +137,9 @@ ext.WINDOWS_NATIVE_COMPILE_ENVIRONMENT = [ ]; def msvcVer = System.getenv("MSVC_VER") ?: "14.10.25017" def msvcBinDir = "" -if (winVsVer == 150) { +if (hasProperty('toolchainDir')) { + msvcBinDir = "$WINDOWS_VS_VSINSTALLDIR/VC/bin/${IS_64 ? 'x64' : 'x86'}" +} else if (winVsVer == 150) { msvcBinDir = (IS_64 ? "$WINDOWS_VS_VSINSTALLDIR/VC/Tools/MSVC/$msvcVer/bin/HostX64/x64" : "$WINDOWS_VS_VSINSTALLDIR/VC/Tools/MSVC/$msvcVer/bin/HostX86/x86") @@ -155,7 +161,6 @@ if (!file(cygpath("$winSdkBinDir/RC.Exe")).exists()) { winSdkBinDir += "/" + (IS_64 ? "x64" : "x86") } } -println "winSdkBinDir=$winSdkBinDir" ext.RC = cygpath("$winSdkBinDir/rc.exe") def rcCompiler = RC @@ -427,6 +432,8 @@ WIN.media.linker = IS_COMPILE_PARFAIT ? "${parfaitPath}/parfait-link.exe" : "lin WIN.media.ar = IS_COMPILE_PARFAIT ? "${parfaitPath}/parfait-lib.exe" : "lib.exe"; WIN.webkit = [:] +WIN.webkit.compiler = compiler +WIN.webkit.linker = linker WIN.webkit.rcCompiler = rcCompiler WIN.webkit.rcSource = defaultRcSource WIN.webkit.rcFlags = ["/d", "JFX_FNAME=jfxwebkit.dll", "/d", "JFX_INTERNAL_NAME=webkit", rcFlags].flatten(); diff --git a/modules/javafx.web/src/main/native/Source/WebCore/PlatformJava.cmake b/modules/javafx.web/src/main/native/Source/WebCore/PlatformJava.cmake index c99b48a91b..0133faf89a 100644 --- a/modules/javafx.web/src/main/native/Source/WebCore/PlatformJava.cmake +++ b/modules/javafx.web/src/main/native/Source/WebCore/PlatformJava.cmake @@ -45,7 +45,7 @@ elseif (APPLE) platform/cf/CFURLExtras.cpp ) # find_library(OPENGL_LIBRARY OpenGL) - find_library(ACCELERATE_LIBRARY accelerate) + find_library(ACCELERATE_LIBRARY Accelerate) list(APPEND WebCore_LIBRARIES ${ACCELERATE_LIBRARY} # ${OPENGL_LIBRARY} diff --git a/modules/javafx.web/src/main/native/Source/WebCore/WebCoreMacros.cmake b/modules/javafx.web/src/main/native/Source/WebCore/WebCoreMacros.cmake index 78d5845430..9f133d0244 100644 --- a/modules/javafx.web/src/main/native/Source/WebCore/WebCoreMacros.cmake +++ b/modules/javafx.web/src/main/native/Source/WebCore/WebCoreMacros.cmake @@ -64,6 +64,7 @@ function(GENERATE_BINDINGS target) set(binding_generator ${WEBCORE_DIR}/bindings/scripts/generate-bindings-all.pl) set(idl_attributes_file ${WEBCORE_DIR}/bindings/scripts/IDLAttributes.json) set(idl_files_list ${CMAKE_CURRENT_BINARY_DIR}/idl_files_${target}.tmp) + set(idl_include_list ${CMAKE_CURRENT_BINARY_DIR}/idl_include_${target}.tmp) set(_supplemental_dependency) set(content) @@ -80,6 +81,7 @@ function(GENERATE_BINDINGS target) --generator ${arg_GENERATOR} --outputDir ${arg_DESTINATION} --idlFilesList ${idl_files_list} + --includeDirsList ${idl_include_list} --preprocessor "${CODE_GENERATOR_PREPROCESSOR}" --idlAttributesFile ${idl_attributes_file} ) @@ -90,13 +92,17 @@ function(GENERATE_BINDINGS target) if (PROCESSOR_COUNT) list(APPEND args --numOfJobs ${PROCESSOR_COUNT}) endif () + set(include_dir) foreach (i IN LISTS arg_IDL_INCLUDES) if (IS_ABSOLUTE ${i}) - list(APPEND args --include ${i}) + set(f ${i}) else () - list(APPEND args --include ${CMAKE_CURRENT_SOURCE_DIR}/${i}) + set(f ${CMAKE_CURRENT_SOURCE_DIR}/${i}) endif () + set(include_dir "${include_dir}${f}\n") endforeach () + file(WRITE ${idl_include_list} ${include_dir}) + foreach (i IN LISTS arg_PP_EXTRA_OUTPUT) list(APPEND args --ppExtraOutput ${i}) endforeach () diff --git a/modules/javafx.web/src/main/native/Source/WebCore/bindings/scripts/generate-bindings-all.pl b/modules/javafx.web/src/main/native/Source/WebCore/bindings/scripts/generate-bindings-all.pl index 9d6a807523..85b5f77031 100644 --- a/modules/javafx.web/src/main/native/Source/WebCore/bindings/scripts/generate-bindings-all.pl +++ b/modules/javafx.web/src/main/native/Source/WebCore/bindings/scripts/generate-bindings-all.pl @@ -48,8 +48,9 @@ my $numOfJobs = 1; my $idlAttributesFile; my $showProgress; +my $includeDirsList; -GetOptions('include=s@' => \@idlDirectories, +GetOptions('includeDirsList=s' => \$includeDirsList, 'outputDir=s' => \$outputDirectory, 'idlFilesList=s' => \$idlFilesList, 'generator=s' => \$generator, @@ -69,6 +70,10 @@ @idlFiles = map { (my $path = $_) =~ s/\r?\n?$//; CygwinPathIfNeeded($path) } <$fh>; close($fh) or die; +open(my $dh, '<', $includeDirsList) or die "Cannot open $includeDirsList"; +@idlDirectories = map { (my $path = $_) =~ s/\r?\n?$//; CygwinPathIfNeeded($path) } <$dh>; +close($dh) or die; + my %oldSupplements; my %newSupplements; if ($supplementalDependencyFile) { @@ -94,7 +99,7 @@ '--preprocessor', $preprocessor, '--idlAttributesFile', $idlAttributesFile, '--write-dependencies'); -push @args, map { ('--include', $_) } @idlDirectories; +push @args, map { ('--includeDirsList', $_) } $includeDirsList; push @args, '--supplementalDependencyFile', $supplementalDependencyFile if $supplementalDependencyFile; my %directoryCache; diff --git a/modules/javafx.web/src/main/native/Source/WebCore/bindings/scripts/generate-bindings.pl b/modules/javafx.web/src/main/native/Source/WebCore/bindings/scripts/generate-bindings.pl index 340e11d12a..86fe387147 100644 --- a/modules/javafx.web/src/main/native/Source/WebCore/bindings/scripts/generate-bindings.pl +++ b/modules/javafx.web/src/main/native/Source/WebCore/bindings/scripts/generate-bindings.pl @@ -57,8 +57,9 @@ my $supplementalDependencyFile; my $additionalIdlFiles; my $idlAttributesFile; +my $includeDirsList; -GetOptions('include=s@' => \@idlDirectories, +GetOptions('includeDirsList=s' => \$includeDirsList, 'outputDir=s' => \$outputDirectory, 'outputHeadersDir=s' => \$outputHeadersDirectory, 'generator=s' => \$generator, @@ -72,6 +73,10 @@ 'additionalIdlFiles=s' => \$additionalIdlFiles, 'idlAttributesFile=s' => \$idlAttributesFile); +open(my $dh, '<', $includeDirsList) or die "Cannot open $includeDirsList"; +@idlDirectories = map { (my $path = $_) =~ s/\r?\n?$//; CygwinPathIfNeeded($path) } <$dh>; +close($dh) or die; + die('Must specify input file.') unless @ARGV; die('Must specify generator') unless defined($generator); die('Must specify output directory.') unless defined($outputDirectory); @@ -263,3 +268,10 @@ sub generateEmptyHeaderAndCpp print FH $contents; close FH; } + +sub CygwinPathIfNeeded +{ + my $path = shift; + return Cygwin::win_to_posix_path($path) if ($^O eq 'cygwin'); + return $path; +} diff --git a/modules/javafx.web/src/main/native/Tools/Scripts/webkitdirs.pm b/modules/javafx.web/src/main/native/Tools/Scripts/webkitdirs.pm index ced9372738..8da0a7924e 100644 --- a/modules/javafx.web/src/main/native/Tools/Scripts/webkitdirs.pm +++ b/modules/javafx.web/src/main/native/Tools/Scripts/webkitdirs.pm @@ -2173,9 +2173,10 @@ sub generateBuildSystemFromCMakeProject } elsif (isJava() && isAnyWindows()) { push @args, "-G"; if (isWin64()) { - push @args, "'Visual Studio 15 2017 Win64'"; + push @args, '"Visual Studio 15 2017 Win64"'; + push @args, '-DCMAKE_GENERATOR_TOOLSET="host=x64"'; } else { - push @args, "'Visual Studio 15 2017'"; + push @args, '"Visual Studio 15 2017"'; } } elsif (isAnyWindows() && isWin64()) { push @args, '-G "Visual Studio 15 2017 Win64"'; From 8cf1e76488ceaa303d0d69f87e7cadbe36ae6b0c Mon Sep 17 00:00:00 2001 From: Arunprasad Rajkumar Date: Tue, 27 Nov 2018 16:34:14 +0530 Subject: [PATCH 2/3] Delete downloaded tarball after extracting it's contents --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 88105bf30f..092b6976a8 100644 --- a/build.gradle +++ b/build.gradle @@ -713,7 +713,7 @@ void fetchExternalTools(String configName, List packages, File destdir, boolean } else { throw new GradleException("Unhandled package type for compile package ${pkgname}") } - srcball.deleteOnExit(); + srcball.delete(); } } else { logger.quiet "all tool packages are present $packages" From e915f702516ccf460f44ca1e55b8597e36e36387 Mon Sep 17 00:00:00 2001 From: Arunprasad Rajkumar Date: Fri, 30 Nov 2018 17:24:53 +0530 Subject: [PATCH 3/3] [Win] Fix build error and CRT dll copying issue --- build.gradle | 2 +- buildSrc/win.gradle | 30 ++++++++++++++++-------------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/build.gradle b/build.gradle index 092b6976a8..7086160891 100644 --- a/build.gradle +++ b/build.gradle @@ -3200,7 +3200,7 @@ project(":web") { exec { workingDir("$webkitOutputDir") def cmakeArgs = "-DENABLE_TOOLS=1" - cmakeArgs = " $cmakeArgs -DCMAKE_C_COMPILER=${webkitProperties.compiler}" + cmakeArgs = " $cmakeArgs -DCMAKE_C_COMPILER='${webkitProperties.compiler}'" if (t.name == "win") { // To enable ninja build on Windows environment(WINDOWS_NATIVE_COMPILE_ENVIRONMENT) diff --git a/buildSrc/win.gradle b/buildSrc/win.gradle index 443700789e..b460a4d67f 100644 --- a/buildSrc/win.gradle +++ b/buildSrc/win.gradle @@ -39,6 +39,8 @@ WIN.library = { name -> return "${name}.dll" as String } WIN.libDest = "bin" WIN.modLibDest = "lib" +def CPU_BITS = IS_64 ? "x64" : "x86" + setupTools("windows_tools", { propFile -> if (project.hasProperty('setupWinTools')) { @@ -79,6 +81,7 @@ setupTools("windows_tools", defineProperty("WINDOWS_DXSDK_DIR", properties, System.getenv().get("DXSDK_DIR")) defineProperty("WINDOWS_VS_INCLUDE", properties, "$WINDOWS_VS_VCINSTALLDIR/INCLUDE;" + "$WINDOWS_SDK_DIR/include;") defineProperty("WINDOWS_VS_VER", properties, "150") + defineProperty("WINDOWS_CRT_VER", properties, "150") defineProperty("WINDOWS_VS_LIB", properties, "$WINDOWS_VS_VCINSTALLDIR/LIB;" + "$WINDOWS_SDK_DIR/lib;") defineProperty("WINDOWS_VS_LIBPATH", properties, "$WINDOWS_VS_VCINSTALLDIR/LIB;") def parfaitPath = IS_COMPILE_PARFAIT ? System.getenv().get("PARFAIT_PATH") + ";" : ""; @@ -138,11 +141,9 @@ ext.WINDOWS_NATIVE_COMPILE_ENVIRONMENT = [ def msvcVer = System.getenv("MSVC_VER") ?: "14.10.25017" def msvcBinDir = "" if (hasProperty('toolchainDir')) { - msvcBinDir = "$WINDOWS_VS_VSINSTALLDIR/VC/bin/${IS_64 ? 'x64' : 'x86'}" + msvcBinDir = "$WINDOWS_VS_VSINSTALLDIR/VC/bin/$CPU_BITS" } else if (winVsVer == 150) { - msvcBinDir = (IS_64 - ? "$WINDOWS_VS_VSINSTALLDIR/VC/Tools/MSVC/$msvcVer/bin/HostX64/x64" - : "$WINDOWS_VS_VSINSTALLDIR/VC/Tools/MSVC/$msvcVer/bin/HostX86/x86") + msvcBinDir = "$WINDOWS_VS_VSINSTALLDIR/VC/Tools/MSVC/$msvcVer/bin/Host${CPU_BITS}/$CPU_BITS" } else if (winVsVer <= 120) { msvcBinDir = (IS_64 ? "$WINDOWS_VS_VSINSTALLDIR/VC/BIN/amd64" @@ -152,13 +153,13 @@ def compiler = IS_COMPILE_PARFAIT ? "cl.exe" : cygpath("$msvcBinDir/cl.exe") def linker = IS_COMPILE_PARFAIT ? "link.exe" : cygpath("$msvcBinDir/link.exe") def winSdkBinDir = "$WINDOWS_SDK_DIR/Bin" if (WINDOWS_VS_VER != "100") { - winSdkBinDir += "/" + (IS_64 ? "x64" : "x86") + winSdkBinDir += "/$CPU_BITS" } if (!file(cygpath("$winSdkBinDir/RC.Exe")).exists()) { winSdkBinDir = "$WINDOWS_SDK_DIR/Bin/$WINDOWS_SDK_VERSION" if (WINDOWS_VS_VER != "100") { - winSdkBinDir += "/" + (IS_64 ? "x64" : "x86") + winSdkBinDir += "/$CPU_BITS" } } @@ -178,20 +179,21 @@ ext.MC = cygpath("$winSdkBinDir/mt.exe") if (!file(RC).exists()) throw new GradleException("FAIL: cannot find RC: " + RC) if (!file(FXC).exists()) throw new GradleException("FAIL: cannot find FXC: " + FXC) -def msvcRedistVer = System.getenv("MSVC_REDIST_VER") ?: "14.10.25008" -String msvcRedstDir = (IS_64 - ? "$WINDOWS_VS_VSINSTALLDIR/VC/Redist/MSVC/$msvcRedistVer/x64" - : "$WINDOWS_VS_VSINSTALLDIR/VC/Redist/MSVC/$msvcRedistVer/x86") +def msvcRedstDir +if (hasProperty('toolchainDir')) { + msvcRedstDir = "$WINDOWS_VS_VSINSTALLDIR/VC/Redist/$CPU_BITS" +} else { + def msvcRedistVer = System.getenv("MSVC_REDIST_VER") ?: "14.10.25008" + msvcRedstDir = "$WINDOWS_VS_VSINSTALLDIR/VC/Redist/MSVC/$msvcRedistVer/$CPU_BITS" +} -String winSdkDllDir = (IS_64 - ? "$WINDOWS_VS_WINSDKDLLINSTALLDIR/x64" - : "$WINDOWS_VS_WINSDKDLLINSTALLDIR/x86") +def winSdkDllDir = "$WINDOWS_VS_WINSDKDLLINSTALLDIR/$CPU_BITS" def WINDOWS_DLL_VER = WINDOWS_VS_VER ext.MSVCR = null ext.MSVCP = null -def windowsCRTVer = System.getenv("WINDOWS_CRT_VER") ?: "150" +def windowsCRTVer = System.getenv("WINDOWS_CRT_VER") ?: WINDOWS_CRT_VER if (WINDOWS_VS_VER == "150") { WINDOWS_DLL_VER = "140" ext.MSVCR = cygpath("${msvcRedstDir}/Microsoft.VC${windowsCRTVer}.CRT/vcruntime${WINDOWS_DLL_VER}.dll")