Skip to content

Commit 9976ce7

Browse files
chironttHannesWell
authored andcommitted
Add swt.win32.aarch64 and compile SWT natives for Windows on Arm64
This commit mainly contains changes to the build.bat file, to support compiling the SWT natives for the WoA platform. On a WoA box, run the following commands to produce the SWT natives (swt*.dll) for WoA: cd binaries\org.eclipse.swt.win32.win32.aarch64 mvn clean process-resources -Dnative=win32.win32.aarch64 and the swt*.dll files for WoA will be created in the current directory. Cross-compiling between the x64 and Arm64 platforms, where either of them can be host or target, is also possible, after setting up the TARGET_ARCH environment variable with correct target architecture value, and with the SWT_JAVA_HOME property pointing to an available JDK of the target architecture. For example, to cross-compile on an x64 host and produce SWT natives for Arm64 target, run the following commands: set TARGET_ARCH=arm64 cd binaries\org.eclipse.swt.win32.win32.aarch64 mvn clean process-resources -Dnative=win32.win32.aarch64 -DSWT_JAVA_HOME=\path\to\arm64_jdk and the swt*.dll files for WoA will be created in the current directory. Note the above SWT_JAVA_HOME property in the command line which points to an available Arm64 JDK of the target architecture. Similarly, to cross-compile on an Arm64 host and produce SWT natives for x64 target, run the following commands: set TARGET_ARCH=x64 cd binaries\org.eclipse.swt.win32.win32.x86_64 mvn clean process-resources -Dnative=win32.win32.x86_64 -DSWT_JAVA_HOME=\path\to\x64_jdk and the swt*.dll files for x64 will be created in the current directory. Note that for cross-compiling between x64 and Arm64 to work, install the MSVC compiler version 2022, with mandatory build tools for both platforms included in the installation. Once the SWT natives for Arm64 are generated, the SWT binaries module's files can be produced with the following build commands in current directory: mvn clean verify -DskipTests=true and the module's jar/zip files will be produced in the target directory: org.eclipse.swt.win32.win32.aarch64-<version>.jar org.eclipse.swt.win32.win32.aarch64-<version>-sources.jar swt-<version>-win32-win32-aarch64.zip Also add the WebView2Loader.dll version 1.0.1150.38 (matching the swt.win32.x86_64 fragment), obtained from the NuGet package microsoft.web.webview2 https://nuget.info/packages/Microsoft.Web.WebView2/1.0.1150.38 located in the sub-folder build/native/arm64
1 parent 103b10e commit 9976ce7

File tree

14 files changed

+1880
-7
lines changed

14 files changed

+1880
-7
lines changed

Jenkinsfile

+10-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ pipeline {
177177
axes {
178178
axis {
179179
name 'PLATFORM'
180-
values 'cocoa.macosx.aarch64' , 'cocoa.macosx.x86_64', 'gtk.linux.aarch64', 'gtk.linux.ppc64le', 'gtk.linux.x86_64', 'win32.win32.x86_64'
180+
values 'cocoa.macosx.aarch64' , 'cocoa.macosx.x86_64', 'gtk.linux.aarch64', 'gtk.linux.ppc64le', 'gtk.linux.x86_64', 'win32.win32.aarch64', 'win32.win32.x86_64'
181181
}
182182
}
183183
stages {
@@ -204,6 +204,15 @@ pipeline {
204204
def (ws, os, arch) = env.PLATFORM.split('\\.')
205205
dir("jdk-download-${os}.${arch}") {
206206
// Fetch the JDK, which provides the C header-files and shared native libaries, against which the natives are build.
207+
if('win32'.equals(os) && 'aarch64'.equals(arch)) {
208+
// Temporary workaround until there are official Temurin GA releases for Windows on ARM that can be consumed through JustJ
209+
sh '''
210+
curl -L 'https://github.com/adoptium/temurin17-binaries/releases/download/jdk17u-2024-02-07-14-14-beta/OpenJDK17U-jdk_aarch64_windows_hotspot_2024-02-07-14-14.zip' > jdk.zip
211+
unzip jdk.zip jdk-17.0.11+1/include/** jdk-17.0.11+1/lib/**
212+
mv jdk-17.0.11+1/include/ .
213+
mv jdk-17.0.11+1/lib/ .
214+
'''
215+
} else
207216
sh "curl ${getNativeJdkUrl(os, arch)} | tar -xzf - include/ lib/"
208217
stash name:"jdk.resources.${os}.${arch}", includes: "include/,lib/"
209218
deleteDir()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>org.eclipse.swt.win32.win32.aarch64</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.pde.ManifestBuilder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
<buildCommand>
19+
<name>org.eclipse.pde.SchemaBuilder</name>
20+
<arguments>
21+
</arguments>
22+
</buildCommand>
23+
<buildCommand>
24+
<name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
25+
<arguments>
26+
</arguments>
27+
</buildCommand>
28+
</buildSpec>
29+
<natures>
30+
<nature>org.eclipse.jdt.core.javanature</nature>
31+
<nature>org.eclipse.pde.PluginNature</nature>
32+
<nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
33+
</natures>
34+
<linkedResources>
35+
<link>
36+
<name>.classpath</name>
37+
<type>1</type>
38+
<locationURI>PARENT-1-PROJECT_LOC/.classpath_win32</locationURI>
39+
</link>
40+
<link>
41+
<name>.settings/.api_filters</name>
42+
<type>1</type>
43+
<locationURI>PROJECT_LOC/.settings/.api_filters</locationURI>
44+
</link>
45+
<link>
46+
<name>.settings</name>
47+
<type>2</type>
48+
<locationURI>PARENT-1-PROJECT_LOC/.settings</locationURI>
49+
</link>
50+
<link>
51+
<name>Eclipse SWT</name>
52+
<type>2</type>
53+
<locationURI>SWT_HOST_PLUGIN/Eclipse%20SWT</locationURI>
54+
</link>
55+
<link>
56+
<name>Eclipse SWT Accessibility</name>
57+
<type>2</type>
58+
<locationURI>SWT_HOST_PLUGIN/Eclipse%20SWT%20Accessibility</locationURI>
59+
</link>
60+
<link>
61+
<name>Eclipse SWT AWT</name>
62+
<type>2</type>
63+
<locationURI>SWT_HOST_PLUGIN/Eclipse%20SWT%20AWT</locationURI>
64+
</link>
65+
<link>
66+
<name>Eclipse SWT Browser</name>
67+
<type>2</type>
68+
<locationURI>SWT_HOST_PLUGIN/Eclipse%20SWT%20Browser</locationURI>
69+
</link>
70+
<link>
71+
<name>Eclipse SWT Custom Widgets</name>
72+
<type>2</type>
73+
<locationURI>SWT_HOST_PLUGIN/Eclipse%20SWT%20Custom%20Widgets</locationURI>
74+
</link>
75+
<link>
76+
<name>Eclipse SWT Drag and Drop</name>
77+
<type>2</type>
78+
<locationURI>SWT_HOST_PLUGIN/Eclipse%20SWT%20Drag%20and%20Drop</locationURI>
79+
</link>
80+
<link>
81+
<name>Eclipse SWT OLE Win32</name>
82+
<type>2</type>
83+
<locationURI>SWT_HOST_PLUGIN/Eclipse%20SWT%20OLE%20Win32</locationURI>
84+
</link>
85+
<link>
86+
<name>Eclipse SWT OpenGL</name>
87+
<type>2</type>
88+
<locationURI>SWT_HOST_PLUGIN/Eclipse%20SWT%20OpenGL</locationURI>
89+
</link>
90+
<link>
91+
<name>Eclipse SWT PI</name>
92+
<type>2</type>
93+
<locationURI>SWT_HOST_PLUGIN/Eclipse%20SWT%20PI</locationURI>
94+
</link>
95+
<link>
96+
<name>Eclipse SWT Printing</name>
97+
<type>2</type>
98+
<locationURI>SWT_HOST_PLUGIN/Eclipse%20SWT%20Printing</locationURI>
99+
</link>
100+
<link>
101+
<name>Eclipse SWT Program</name>
102+
<type>2</type>
103+
<locationURI>SWT_HOST_PLUGIN/Eclipse%20SWT%20Program</locationURI>
104+
</link>
105+
<link>
106+
<name>Eclipse SWT WebKit</name>
107+
<type>2</type>
108+
<locationURI>SWT_HOST_PLUGIN/Eclipse%20SWT%20WebKit</locationURI>
109+
</link>
110+
</linkedResources>
111+
<variableList>
112+
<variable>
113+
<name>SWT_HOST_PLUGIN</name>
114+
<value>$%7BPARENT-2-PROJECT_LOC%7D/bundles/org.eclipse.swt</value>
115+
</variable>
116+
</variableList>
117+
</projectDescription>

0 commit comments

Comments
 (0)