Skip to content

Commit

Permalink
Add cmake presets for Linux and Windows
Browse files Browse the repository at this point in the history
Allowing building stuff using `cmake --preset ...` and not having to
specify so many parameters. Use `cmake --list-presets` to see all of
them.

The presets assume that you're building for your own system, so they
enable -march=native in release mode, export compiel commands and turn
on SOURCE_ASSETS. They always use `build` as the build directory and on
Windows `install` as the installation directory, but that can be
overridden on the command line. Windows assumes you're using vcpkg and
installed it into `C:\vcpkg` like the build instructions tell you to do.

The presets are generated using a script because the JSON format they
came up with doesn't have particularly great deduplication facilities
and we want to generate quite a lot of permutations.

Also extends .gitignore appropriately so that it will ignore any
directory with `install` in the name and the file
`CMakeUserPresets.json`, which can be used by the user to extend and
customize presets for their own purposes.
  • Loading branch information
askmeaboutlo0m committed Dec 15, 2023
1 parent f24a365 commit a76e788
Show file tree
Hide file tree
Showing 3 changed files with 1,237 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
Makefile
Makefile.*
CMakeLists.txt.user*
CMakeUserPresets.json

# Build directories
/*build*/
**/target
**/target/
/*install*/

*.swp

Expand Down
Loading

0 comments on commit a76e788

Please sign in to comment.