The document is structured so that you only need to read up to the point that you require, with advanced topics at the bottom.
The SWT windows port is based on the Win32 api.
The natives are compiled via an ant build.xml script with the Microsoft Visual Studio (2017) C++ compiler.
SWT is made up of 2 parts, Java and the natives (written in C).
Java Part
If you only make changes in the Java part or need to configure SWT for running snippets, then you don't need to recompile the natives, instead, you can just use the pre-compiled libraries in the binary repository.
Natives Part
(Make sure the binary project for your platform is imported and open in your workspace).
(Last Tested on Win10 64 bit & Java 9. March 2018):
You need to install the following on your system:
In the binary git repo, in the windows project, you can build the natives via the build.xml. To do so:
To test if you binaries actually get used, you could try to checkout an older binary repo commit with old bindings. Then try to run a snippet and get the ‘missing natives’ error. Then if you build the natives and the snippet(s) work, it shows that you've build them successfully.
Note, I.E is the default backend. But Webkit is also a possible alternative Browser backend.
Disclaimer:
Note Webkit SDKs are an older version being consumed by SWT native build process and Webkit build binaries are no more available for download in public Webkit download page (https://webkit.org/downloads/)
But WebKit-r72896 sources are still avilable for download via either of: https://builds-nightly.webkit.org/files/trunk/src/WebKit-r72896.tar.bz2
http://build.eclipse.org/eclipse/swt/WebKit-r72896.tar.bz2
Webkit SDKs:
Steps:
C:\SWT_BUILD_DIR
set SWT_BUILD_DIR=YOUR.DIR
SWT_BUILD_DIR\Webkit\r72896
SWT_BLUID_DIR\Webkit\SupportLibrary
You can specify a specific java sdk via:set SWT_JAVA_HOME=<YOUR_PATH>
To do a 32 bit build, install a 32bit java & specify it's path or put it into: SWT_BUILD_DIR\Java\Oracle\jdk1.8.0-latest\x86
For building windows native build for 32bit, you need to convert the source to 32bit first, by running ‘replace.64.to.32’ target.
Once sources are converted to 32bit you can run the ‘build_libraries’ target for ${workspace_loc:/org.eclipse.swt.win32.win32.x86/build.xml}
(Optional for local setup)
Now you can point the Windows hudson job to this machine and trigger a native build.
Note: For testing purpose from hudson, temporarily turn the nativeChanges flag to ‘true’ to force a native build compilation.