-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
26 lines (19 loc) · 786 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# This makefile is used to shorten build commands with various toolchains.
# You can build the project without it, just calling the CMake manually.
BUILD_DIR ?= build
BUILD_TYPE ?= Debug
.PHONY: gcc msvc install clean
all: gcc # Default toolchain
gcc:
$(eval export CC = gcc)
$(eval export CXX = g++)
cmake . -B$(BUILD_DIR) -G Ninja -DCMAKE_BUILD_TYPE=$(BUILD_TYPE)
cmake --build $(BUILD_DIR) -j
msvc:
"$(shell ${ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere -prerelease -latest -property installationPath)\VC\Auxiliary\Build\vcvarsall.bat" x64 && \
cmake . -B$(BUILD_DIR) -G Ninja -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) && \
cmake --build $(BUILD_DIR) -j
install:
cmake --install $(BUILD_DIR) --prefix $(BUILD_DIR)/install
clean:
@cmake -E rm -rf $(BUILD_DIR)