forked from scream3r/java-simple-serial-connector
-
Notifications
You must be signed in to change notification settings - Fork 56
Windows Build Environment
GKenn edited this page Jul 23, 2021
·
1 revision
This builds the library based on the Visual C++ compiler.
JSSC uses the Microsoft Visual Studio C++ compiler (MSVC) to compile native bits on Windows, set automatically using VsDevCmd.bat. JSSC also supports the mingw cross-compiler.
Starting point: A clean Windows installation with all patches.
- Install "Visual Studio Community 2019" or the "Build Tools for Visual Studio 2019" (https://visualstudio.microsoft.com/downloads/)
- Windows 10 SDK
- MSVC v142 - VS 2019 C++-x64/x86-Buildtools
- MSVC v142 - VS 2019 C++-ARM64-Buildtools (optional, for ARM64 targets)
- Windows Universal CRT SDK
- Manually install Java from https://adoptopenjdk.net
- Manually install Maven from https://maven.apache.org/, adding
mvn.batdirectory to your%PATH% - Manually install CMake from https://cmake.org/download/, adding
cmake.exedirectory to your%PATH%
Note: The paths below are samples and depend on the exact versions installed.
- For example for "Visual Studio Community 2019"
vcvarsall.batcan be found here:C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat. - ... while for "Build Tools for Visual Studio 2019"
vcvarsall.batis found here:C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvarsall.bat.
-
Open command line for the following actions - if Visual Studio IDE is installed you will also have versions of PowerShell command line available that are pre-configured for this
-
Setup the Visual Studio build environment using vcvarsall in <host>_<target> notation:
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x64Compile:
mvn -P x86_64 # compile for 64-bit x86_64/amd64"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x64_x86Compile:
mvn -P x86 # compile for 32-bit x86"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x64_arm64Compile:
mvn -P aarch64 # compile for arm64