From d9e6e808d85daf9cadcd1bf4e48a2c75bd4c6814 Mon Sep 17 00:00:00 2001 From: Jocadbz Date: Sat, 27 Dec 2025 10:53:06 -0300 Subject: [PATCH] Add build directives to most cpp files --- src/fossvg.cpp | 5 +++++ src/lib/cli.cpp | 4 ++++ src/lib/file.cpp | 4 ++++ src/lib/game/block.cpp | 1 + src/lib/game/entity.cpp | 1 + src/lib/javacompat.hpp | 2 +- src/lib/nbt.cpp | 6 +++++- src/lib/net/connection.hpp | 2 +- src/lib/net/tcp_client.c | 4 ++++ src/lib/net/tcp_server.c | 4 ++++ src/lib/region.cpp | 4 ++++ src/lib/zlibutil.cpp | 4 ++++ src/tools/hexnet.cpp | 4 ++-- 13 files changed, 40 insertions(+), 5 deletions(-) diff --git a/src/fossvg.cpp b/src/fossvg.cpp index 8c35b3c..bdece4f 100644 --- a/src/fossvg.cpp +++ b/src/fossvg.cpp @@ -1,3 +1,8 @@ +// build-directive: unit-name(fossvg) +// build-directive: link(cli.so) +// build-directive: ldflags(-lglfw -lrt -lm -ldl) +// build-directive: out(fossvg) +// build-directive: static(false) // Copyright 2022, FOSS-VG Developers and Contributers // // Author(s): diff --git a/src/lib/cli.cpp b/src/lib/cli.cpp index 8956fef..f159a82 100644 --- a/src/lib/cli.cpp +++ b/src/lib/cli.cpp @@ -1,3 +1,7 @@ +// build-directive: unit-name(lib/cli) +// build-directive: out(lib/cli) +// build-directive: shared(true) +// build-directive: cflags(-fPIC -std=c++20) // Copyright 2022, FOSS-VG Developers and Contributers // // Author(s): diff --git a/src/lib/file.cpp b/src/lib/file.cpp index c6ffb31..ae00729 100644 --- a/src/lib/file.cpp +++ b/src/lib/file.cpp @@ -1,3 +1,7 @@ +// build-directive: unit-name(lib/file) +// build-directive: out(lib/file) +// build-directive: shared(true) +// build-directive: cflags(-fPIC) // Copyright 2022, FOSS-VG Developers and Contributers // // Author(s): diff --git a/src/lib/game/block.cpp b/src/lib/game/block.cpp index e69de29..8b13789 100644 --- a/src/lib/game/block.cpp +++ b/src/lib/game/block.cpp @@ -0,0 +1 @@ + diff --git a/src/lib/game/entity.cpp b/src/lib/game/entity.cpp index e69de29..8b13789 100644 --- a/src/lib/game/entity.cpp +++ b/src/lib/game/entity.cpp @@ -0,0 +1 @@ + diff --git a/src/lib/javacompat.hpp b/src/lib/javacompat.hpp index 4121a76..65a53e0 100644 --- a/src/lib/javacompat.hpp +++ b/src/lib/javacompat.hpp @@ -18,7 +18,7 @@ #include #include #include "error.hpp" -#include "../../.endianness" +#include "endianness" #ifdef FOSSVG_ENDIAN_BIG_WORD #error "Honeywell-316-style endianness is not supported. If you feel like it should, feel free to participate in the project to maintain it." diff --git a/src/lib/nbt.cpp b/src/lib/nbt.cpp index acf8ee9..4ba15ec 100644 --- a/src/lib/nbt.cpp +++ b/src/lib/nbt.cpp @@ -1,3 +1,7 @@ +// build-directive: unit-name(lib/nbt) +// build-directive: out(lib/nbt) +// build-directive: shared(true) +// build-directive: cflags(-fPIC) // Copyright 2022, FOSS-VG Developers and Contributers // // This program is free software: you can redistribute it and/or modify it @@ -23,7 +27,7 @@ #include "javacompat.hpp" -#include "../../.endianness" +#include "endianness" #ifdef FOSSVG_ENDIAN_BIG_WORD #error "Honeywell-316-style endianness is not supported. If you feel like it should, feel free to participate in the project to maintain it." #endif diff --git a/src/lib/net/connection.hpp b/src/lib/net/connection.hpp index f6cc2d9..9500ead 100644 --- a/src/lib/net/connection.hpp +++ b/src/lib/net/connection.hpp @@ -20,7 +20,7 @@ #include -#include "../error.hpp" +#include "error.hpp" namespace network { struct Connection { diff --git a/src/lib/net/tcp_client.c b/src/lib/net/tcp_client.c index 143a4fc..7dd54e4 100644 --- a/src/lib/net/tcp_client.c +++ b/src/lib/net/tcp_client.c @@ -1,3 +1,7 @@ +// build-directive: unit-name(lib/net/tcp_client) +// build-directive: out(lib/net/tcp_client) +// build-directive: shared(true) +// build-directive: cflags(-fPIC) // Copyright 2022, FOSS-VG Developers and Contributers // // Author(s): diff --git a/src/lib/net/tcp_server.c b/src/lib/net/tcp_server.c index 143a4fc..dc68420 100644 --- a/src/lib/net/tcp_server.c +++ b/src/lib/net/tcp_server.c @@ -1,3 +1,7 @@ +// build-directive: unit-name(lib/net/tcp_server) +// build-directive: out(lib/net/tcp_server) +// build-directive: shared(true) +// build-directive: cflags(-fPIC) // Copyright 2022, FOSS-VG Developers and Contributers // // Author(s): diff --git a/src/lib/region.cpp b/src/lib/region.cpp index 5d77128..4adff81 100644 --- a/src/lib/region.cpp +++ b/src/lib/region.cpp @@ -1,3 +1,7 @@ +// build-directive: unit-name(lib/region) +// build-directive: out(lib/region) +// build-directive: shared(true) +// build-directive: cflags(-fPIC) // Copyright 2023, FOSS-VG Developers and Contributers // // Author(s): diff --git a/src/lib/zlibutil.cpp b/src/lib/zlibutil.cpp index e872cad..a634d2e 100644 --- a/src/lib/zlibutil.cpp +++ b/src/lib/zlibutil.cpp @@ -1,3 +1,7 @@ +// build-directive: unit-name(lib/zlibutil) +// build-directive: out(lib/zlibutil) +// build-directive: shared(true) +// build-directive: cflags(-fPIC) // Copyright 2022, FOSS-VG Developers and Contributers // // Author(s): diff --git a/src/tools/hexnet.cpp b/src/tools/hexnet.cpp index 04c88f3..d46b6bd 100644 --- a/src/tools/hexnet.cpp +++ b/src/tools/hexnet.cpp @@ -31,8 +31,8 @@ #include #include -#include "../lib/cli.hpp" -#include "../lib/error.hpp" +#include "cli.hpp" +#include "error.hpp" #define EXIT_SUCCESS 0 #define EXIT_RUNTIME 1