Last active
February 20, 2025 13:16
-
-
Save mortie/2eeec1f6e75b79a3d6ebe7700f1c769d to your computer and use it in GitHub Desktop.
Meson C++
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OUT ?= build | |
PROGRAM = example | |
.PHONY: build | |
build: $(OUT)/build.ninja | |
ninja -C $(OUT) $(PROGRAM) | |
.PHONY: setup | |
setup: $(OUT)/build.ninja | |
$(OUT)/build.ninja: | |
meson setup $(OUT) | |
.PHONY: run | |
run: build | |
cd $(OUT) && $(CMD) ./$(PROGRAM) | |
.PHONY: clean | |
clean: | |
ninja -C $(OUT) clean | |
.PHONY: cleanall | |
cleanall: | |
rm -rf $(OUT) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
project( | |
'example', 'cpp', | |
default_options: ['cpp_std=c++20'], | |
) | |
executable( | |
'example', | |
'src/main.cc', | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment