wataash's single-file utility library. Very WIP.
In single c++ source in your project (usually the one containing main()
):
#define WUTILS_IMPL
#include "path/to/wutils.cc"
And other files should include me without WUTILS_IMPL
:
#include "path/to/wutils.cc"
One c++
(g++
/clang++
) invocation is needed. In your Makefile:
SOURCES += path/to/wutils.cc
CPPFLAGS += -include path/to/wutils.cc # TODO: test
CPPFLAGS += -DWUTILS_IMPL_IF_CXX
Then let your C sources #include "path/to/wutils.cc"
.
TODO
-lwutils
-lwutils -lstdc++ # for C project
- In order to reduce compilation time. (avoid compiling
static inline
functions from all files includingwutils.cc
) - Making shared/static library would be easy. (TODO)