Skip to content

Build methods

kms1212 edited this page Mar 16, 2022 · 21 revisions

For Windows platforms (MSVC)

Dependencies

  • CMake >=3.4 (not tested, latest recommended)
  • NASM latest
  • Visual Studio >=2013 (not tested, latest recommended)
  • jq
  • 7zip (optional, for testing library)
  • NSIS (optional, for generating package binary)
  • OpenSSL
  • zlib
  • Doxygen, graphviz (optional, for generating documents)

Build

Clone repository

Clone the source code of OpenFSL using

git clone https://github.com/kms1212/OpenFSL.git

Configure CMake

cd path/to/repo # Repository path
cmake -S. -B{Build Directory} \ # Source and build directory
      -G “Visual Studio 2019” \ # Project generator.
      -A x64 \ # Target architecture
      -Doptions=value # Options

Options

Option Description Type Default
CMAKE_BUILD_TYPE Project build type(Debug, Release) String Not Set
NO_BUILD Do not build library Bool false
BUILD_TESTING Build and run the test suite for this project Bool true
BUILD_APP Build the test application project for this project Bool false
BUILD_FAT32 Build FAT32 module Bool true
BUILD_NTFS Build NTFS module Bool true
LIBRARY_TYPE Library type(SHARED, STATIC) String SHARED
DOXYGEN_GENERATE Generate Doxygen documents Bool false
PACKAGE_TYPE Set package type(NIGHTLY, BETA, RELEASE) String NIGHTLY
PACKAGE_GENERATE Generate package Bool false
PACKAGE_GENERATOR Set package generator(TGZ, STGZ, TBZ2, ZIP, NSIS[64]) String ZIP

Run build methods

On CMake with Visual Studio, you have to specify build type once more with --config argument in build time.
For example: If you specified CMAKE_BUILD_TYPE to Release in configuration time

cmake --build {Build Directory} --config Release --target all_build

If you specified CMAKE_BUILD_TYPE to Debug in configuration time

cmake --build {Build Directory} --config Debug --target all_build

Run test

ctest --test-dir {Build Directory} --build-config {Build Type}

Create package

cmake --build {Build Directory} --target package

Run build, test, package at once

cmake --build {Build Directory} --config {Build Config} --target all_build run_tests package

For Windows platforms (MinGW)

Dependencies

  • CMake >=3.4 (not tested, latest recommended)
  • NASM latest
  • MinGW GCC latest
  • jq
  • OpenSSL
  • zlib
  • 7zip (optional, for testing library)
  • NSIS (optional, for generating package binary)
  • Doxygen, graphviz (optional, for generating documents)

Currently Chocolatey package doxygen.install has a problem, you have to manually specify the path of Doxygen folder to PATH.

Build

Clone repository

Clone the source code of OpenFSL using

git clone https://github.com/kms1212/OpenFSL.git

Configure CMake

cd path/to/repo # Repository path
cmake -S. -B{Build Directory} \ # Source and build directory
      -Doptions=value # Options

Options

Option Description Type Default
CMAKE_BUILD_TYPE Project build type(Debug, Release) String Not Set
NO_BUILD Do not build library Bool false
TARGET_ARCHITECTURE Target architecture for gcc String native
BUILD_TESTING Build and run the test suite for this project Bool true
BUILD_APP Build the test application project for this project Bool false
BUILD_FAT32 Build FAT32 module Bool true
BUILD_NTFS Build NTFS module Bool true
LIBRARY_TYPE Library type(SHARED, STATIC) String SHARED
DOXYGEN_GENERATE Generate Doxygen documents Bool false
PACKAGE_TYPE Set package type(NIGHTLY, BETA, RELEASE) String NIGHTLY
PACKAGE_GENERATE Generate package Bool false
PACKAGE_GENERATOR Set package generator(TGZ, STGZ, TBZ2, ZIP, NSIS[64]) String ZIP

Run build methods

On CMake with Visual Studio, you have to specify build type once more with --config argument in build time.
For example: If you specified CMAKE_BUILD_TYPE to Release in configuration time

cmake --build {Build Directory} --config Release --target all_build

If you specified CMAKE_BUILD_TYPE to Debug in configuration time

cmake --build {Build Directory} --config Debug --target all_build

Run test

ctest --test-dir {Build Directory} --build-config {Build Type}

Create package

cmake --build {Build Directory} --target package

Run build, test, package at once

cmake --build {Build Directory} --config {Build Config} --target all_build run_tests package

For Unix-like platforms

Dependencies

  • CMake >=3.4 (not tested, latest recommended)
  • NASM latest
  • GCC / Clang latest
  • GNU binutils / LLVM latest
  • GNU make / BSD make
  • jq
  • OpenSSL
  • zlib
  • zip (optional, for testing library)
  • Doxygen, graphviz (optional, for generating documents)

Build

Clone repository

Clone the source code of OpenFSL using

git clone https://github.com/kms1212/OpenFSL.git

Configure CMake

cd path/to/repo # Repository path
cmake -S. -B{Build Directory} \ # Source and build directory
      -Doptions=value # Options

Options

Option Description Type Default
CMAKE_BUILD_TYPE Project build type(Debug, Release) String Not Set
TARGET_ARCHITECTURE Target architecture for gcc(Depends on compiler) String native
TARGET_TRIPLET Target system triplet for clang(def. x86_64-unknown-linux-gnu) String x86_64-unknown-linux-gnu
NO_BUILD Do not build library Bool false
BUILD_TESTING Build and run the test suite for this project Bool true
BUILD_APP Build the test application project for this project Bool false
BUILD_FAT32 Build FAT32 module Bool true
BUILD_NTFS Build NTFS module Bool true
LIBRARY_TYPE Library type(SHARED, STATIC) String SHARED
DOXYGEN_GENERATE Generate Doxygen documents Bool false
PACKAGE_TYPE Set package type(NIGHTLY, BETA, RELEASE) String NIGHTLY
PACKAGE_GENERATE Generate package Bool false
PACKAGE_GENERATOR Set package generator(TGZ, STGZ, TBZ2, ZIP, DEB, RPM) String ZIP

Run build methods

cmake --build {Build Directory} --target all

Run test

ctest --test-dir {Build Directory}

Create package

cmake --build {Build Directory} --target package

Run build, test, package at once

cmake --build {Build Directory} --target all test package

Build automatically

Shell script for the automatic build is available. The autobuild script supports RHEL, Alpine, Arch, SuSE, Debian and FreeBSD. Tested with Debian and FreeBSD.

sudo bash autobuild.sh