quick-lint-js contributors should use the CMake meta build system.
Recommended process:
- Run CMake to create a build directory containing project files.
- Run your build tool to compile quick-lint-js and its tests.
- Run quick-lint-js' tests directly.
The exact commands you need to run differs depending on your preferred development environment and build tool:
Install CMake and Ninja, then run the following command to create a
directory called build
:
$ cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -S . -B build
Run the following command to build the quick-lint-js executable, quick-lint-js' tests, and quick-lint-js' benchmarks:
$ ninja -C build
If you only want to build the quick-lint-js executable:
$ ninja -C build quick-lint-js
If you only want to build quick-lint-js' tests:
$ ninja -C build quick-lint-js-test
Run the following command to run quick-lint-js' test suite:
$ ./build/test/quick-lint-js-test
If you want to run the quick-lint-js program:
$ ./build/quick-lint-js
Install CMake, then run the following command to create a
directory called build
:
$ cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=Debug -S . -B build
Run the following command to build the quick-lint-js executable, quick-lint-js' tests, and quick-lint-js' benchmarks:
$ make -j4 -C build
If you only want to build the quick-lint-js executable:
$ make -j4 -C build quick-lint-js
If you only want to build quick-lint-js' tests:
$ make -j4 -C build quick-lint-js-test
Run the following command to run quick-lint-js' test suite:
$ ./build/test/quick-lint-js-test
If you want to run the quick-lint-js program:
$ ./build/quick-lint-js
Install CMake and Visual Studio 2019. Open x64 Native
Tools Command Prompt for VS. Use cd
to navigate to your quick-lint-js project
directory. Run the following command to create a directory called build
:
> cmake -G "Visual Studio 16 2019" -S . -B build
Open the Visual Studio solution in the build
directory:
> start build\quick-lint-js.sln
In Visual Studio, build the solution: press F6, or select the Build > Build Solution menu option.
Open the Solution Explorer panel, right-click the quick-lint-js-test project, and select the Set as StartUp Project menu option.
Run the test program: press F5, or select the Debug > Start Debugging menu option.
If you want to run the quick-lint-js program, you can find it in
build\Debug\quick-lint-js.exe
. Run it from a command prompt or PowerShell
window.
This is for advanced users only. You need to install the Nix package manager if you have not already done so.
Nix uses derivation files that contain instructions for automation on how
to build and package software. The dist/
folder contains such derivations for
quick-lint-js and can be used to download dependencies and build it.
The derivations in dist/
contain the necessary dependencies to build
quick-lint-js using cmake and ninja. We can use nix-shell
to download those
dependencies and make them available for development.
$ nix-shell dist/shell.nix
While it seems this does not do anything, you will be dropped in a shell that has the build tools available necessary to build quick-lint-js. Once you exit this shell, the downloaded dependencies will not be available anymore. You can use the above command again to re-create a shell with the build tools available at any time.
After running above command, we configure the build environment:
$ cmakeConfigurePhase
This will create a build/
folder in the project folder and changes the
current directory to it.
To build quick-lint-js, make sure you are in the build/
folder; the
previous command should have already put you there. To start the build
using ninja, you use:
$ ninjaBuildPhase
After building, the binary is available as quick-lint-js
in the build
folder:
$ ./quick-lint-js
To run the tests, execute the test binary in the build directory:
$ ./test/quick-lint-js-test