diff options
author | kdx <kikoodx@paranoici.org> | 2023-07-13 01:43:35 +0200 |
---|---|---|
committer | kdx <kikoodx@paranoici.org> | 2023-07-13 01:43:35 +0200 |
commit | 015247af10e5f70d636559d7a2fa2adc113c2057 (patch) | |
tree | 1f391d900e42d3d52a635bafbf23b82614b27250 | |
parent | cdfa78a8bc48b4170bc161564b27fa23b352db21 (diff) | |
download | fld-015247af10e5f70d636559d7a2fa2adc113c2057.tar.gz |
modules are cringe
-rw-r--r-- | Makefile | 16 | ||||
-rw-r--r-- | _head.cpp | 2 | ||||
-rw-r--r-- | compile_flags.txt | 1 | ||||
-rwxr-xr-x | create_FLD.cpp.sh | 2 | ||||
-rw-r--r-- | demo.cpp | 5 |
5 files changed, 10 insertions, 16 deletions
@@ -1,23 +1,17 @@ -CFLAGS = -O3 -std=c++20 -Wall -Wextra +CFLAGS = -O3 -std=c++20 -Wall -Wextra -iquotesrc LIBS = -lSDL2 -SRC = FLD.pcm demo.cpp +SRC = FLD.cpp demo.cpp all: demo FLD.cpp: ./create_FLD.cpp.sh -FLD.pcm: FLD.cpp - clang++ $(CFLAGS) -c -o $@ -Xclang -emit-module-interface $< - -demo: demo.o FLD.pcm - clang++ $(CFLAGS) -o $@ demo.o FLD.pcm $(LIBS) - -demo.o: demo.cpp FLD.pcm - clang++ $(CFLAGS) -fprebuilt-module-path=. -c -o $@ demo.cpp +demo: $(SRC) + clang++ $(CFLAGS) -o $@ $(SRC) $(LIBS) clean: - rm -rf FLD.cpp FLD.pcm TZR.h demo demo.o build_FLD.cpp + rm -rf FLD.cpp demo build_FLD.cpp re: @$(MAKE) --no-print-directory clean @@ -1,4 +1,2 @@ /* Licensing information can be found at the end of the file. */ -module; - diff --git a/compile_flags.txt b/compile_flags.txt index 85c506c..a33c7b6 100644 --- a/compile_flags.txt +++ b/compile_flags.txt @@ -2,3 +2,4 @@ -Wextra -std=c++20 -fprebuilt-module-path=. +-iquotesrc diff --git a/create_FLD.cpp.sh b/create_FLD.cpp.sh index 69b9d63..e6bce11 100755 --- a/create_FLD.cpp.sh +++ b/create_FLD.cpp.sh @@ -8,13 +8,11 @@ for FILE in src/FLD.hpp src/*.cpp; do printf '/* %s */\n' "$FILE" >>"$BUILDDIR/sources" grep -v '^#include' "$FILE" \ | grep -v "^#pragma" \ - | sed 's/^class FLD/export class FLD/' \ >>"$BUILDDIR/sources" done cp _head.cpp "$BUILDDIR/out" sort -u "$BUILDDIR/includes" >>"$BUILDDIR/out" -printf '\nexport module FLD;\n' >>"$BUILDDIR/out" cat "$BUILDDIR/sources" >>"$BUILDDIR/out" printf '\n' >>"$BUILDDIR/out" cat _tail.cpp >>"$BUILDDIR/out" @@ -1,4 +1,6 @@ -import FLD; +#include <iostream> +#include <format> +#include "FLD.hpp" static int main_loop(FLD& fld, [[maybe_unused]] void *udata) @@ -7,6 +9,7 @@ main_loop(FLD& fld, [[maybe_unused]] void *udata) return 1; fld.drawSetColor(0, 0, 0); + fld.drawClear(); fld.drawSetColor(1, 1, 1); fld.drawRectangle({ 16, 32, 64, 32 }); |