Skip to content

Latest commit

 

History

History
117 lines (94 loc) · 3.38 KB

HACKING.md

File metadata and controls

117 lines (94 loc) · 3.38 KB

Hacking

Here is some wisdom to help you build and test this project as a developer and potential contributor.

If you plan to contribute, please read the CONTRIBUTING guide.

Please also see BUILDING for the necessary dependencies. We should migrate to vcpkg fully in the future, so manually installing them should not be necessary anymore.

Developer mode

Build system targets that are only useful for developers of this project are hidden if the tasarch_DEVELOPER_MODE option is disabled. Enabling this option makes tests and other developer targets and options available. Not enabling this option means that you are a consumer of this project and thus you have no need for these targets and options.

Developer mode is always set to on in CI workflows.

Presets

This project makes use of presets to simplify the process of configuring the project. As a developer, you are recommended to always have the latest CMake version installed to make use of the latest Quality-of-Life additions.

You have a few options to pass tasarch_DEVELOPER_MODE to the configure command, but this project prefers to use presets.

As a developer, you should create a CMakeUserPresets.json file at the root of the project:

{
  "version": 2,
  "cmakeMinimumRequired": {
    "major": 3,
    "minor": 14,
    "patch": 0
  },
  "configurePresets": [
    {
      "name": "dev",
      "binaryDir": "${sourceDir}/build/dev",
      "inherits": ["dev-mode", "ci-<os>"],
      "cacheVariables": {
        "CMAKE_BUILD_TYPE": "Debug"
      }
    }
  ],
  "buildPresets": [
    {
      "name": "dev",
      "configurePreset": "dev",
      "configuration": "Debug"
    }
  ],
  "testPresets": [
    {
      "name": "dev",
      "configurePreset": "dev",
      "configuration": "Debug",
      "output": {
        "outputOnFailure": true
      }
    }
  ]
}

You should replace <os> in your newly created presets file with the name of the operating system you have, which may be win64 or unix. You can see what these correspond to in the CMakePresets.json file.

CMakeUserPresets.json is also the perfect place in which you can put all sorts of things that you would otherwise want to pass to the configure command in the terminal.

If you want to use Xcode as your IDE, you can add the following to the configurePresets:

{
  "name": "xcode",
  "inherits": "dev-unix",
  "binaryDir": "${sourceDir}/build/xcode",
  "generator": "Xcode"
}

Then just run cmake --preset=xcode && open build/xcode/tasarch.xcodeproj.

Configure, build and test

If you followed the above instructions, then you can configure, build and test the project respectively with the following commands from the project root on any operating system with any build system:

cmake --preset=dev
cmake --build --preset=dev
ctest --preset=dev

Please note that both the build and test command accepts a -j flag to specify the number of jobs to use, which should ideally be specified to the number of threads your CPU has. You may also want to add that to your preset using the jobs property, see the presets documentation for more details.

Editing Qt Files

Your Qt installation should have Qt Designer and others to edit the respective Qt files. .ui is edited with the Designer.