Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds support for modern CMake #8

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Commits on Jan 24, 2021

  1. Adds support for modern CMake

    The primary purpose of this commit is to incorporate modern CMake
    (>=3.1) best practices. As a result, a reorganization of the directory
    structure as well as a few minor code cleanups was required. A summary
    of those changes follows:
    * Moves all header files into a separate include directory.
    * The test directory was renamed to apps, to allow for future unit tests
      to be written and included in a directory named test.
    * The win32 shims should only be included when compiling in a Windows
      environment. Upstream checks this by testing the CMake variable
      `MSVC`. However, this commit uses generator expressions and the more
      general test of the CMake Platform ID being equal to `Windows`.
    * All options and other configurable behavior of the CMakeLists file is
      implemented using generator-expressions.
    * Makes the GKlib apps disabled by default if the GKlib library is not
      the top CMake project and enabled if it is. This way, when GKlib is a
      dependency of another project, the apps are not build by default. An
      option, GKLIB_BUILD_APPS, was added to allow projects depending on
      GKlib to also build the apps.
    * Moves feature availability checks from `GKlibSystem.cmake` to the main
      `CMakeLists.txt`. This is to separate concerns, `CMakeLists.txt`
      contains core CMake logic, while `GKlibSystem.cmake` contains common
      compiler options and the like, which are convenient defaults, but may
      not be appropriate for all user of the build system.
    jiverson002 committed Jan 24, 2021
    Configuration menu
    Copy the full SHA
    652d206 View commit details
    Browse the repository at this point in the history
  2. Adds support for Travis CI

    Adds support for testing successful compilation (w/ and w/o apps) on
    Travis using Linux, Windows, and Apple.
    jiverson002 committed Jan 24, 2021
    Configuration menu
    Copy the full SHA
    26a94c3 View commit details
    Browse the repository at this point in the history
  3. Cleans up source

    This primary purpose of this commit is to make some minor changes to the
    code to clean it up a bit. Notable changes are as follows:
    * The macro `__OPENMP__` is replaced by `_OPENMP`. `__OPENMP__` was an
      artifact from the old build system, which defined such a macro when
      the build was configured with OpenMP support. According to the [OpenMP
      specification](https://www.openmp.org/specifications/) Section
      [2.2](https://www.openmp.org/spec-html/5.1/openmpse10.html#x38-370002.2) "the
      `_OPENMP` macro name is defined to have the decimal value *yyyymm*
      where *yyyy* and *mm* are the year and month designations of the
      version of the OpenMP API that the implementation supports." As such,
      it should be the preferred way to check for OpenMP support during
      compilation.
    * The preprocessor condition `defined(__WITHPCRE__)` is replaced by
      `defined(USE_PCRE) && defined(HAVE_PCREPOSIX_H)`. `__WITHPCRE__` was an
      artifact from the old build system, which was defined during configuration if
      the build system user requested PCRE support. This functionality has been
      replaced by the macro name `USE_PCRE` to be consistent with the other feature
      availability checks done in the core CMake logic and the condition has been
      extended to not only check for the request (`USE_PCRE`), but also the
      availability of the necessary header file, namely `pcreposix.h` indicated by
      the macro name `HAVE_PCREPOSIX_H` being defined during CMake configuration.
    jiverson002 committed Jan 24, 2021
    Configuration menu
    Copy the full SHA
    fd87121 View commit details
    Browse the repository at this point in the history