From c6a854fac3f235b88d0bf2d57b2b3a6f80583956 Mon Sep 17 00:00:00 2001 From: q66 Date: Mon, 19 Jun 2017 17:09:30 +0200 Subject: [PATCH] clearer readme --- README.md | 39 ++++++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index cb14421..d4a4ee3 100644 --- a/README.md +++ b/README.md @@ -18,17 +18,42 @@ files in there directly if you don't need the API documentation. ## Building Libostd is built using the supplied C++ build tool. You need to compile the -build tool first using the compiler you will use to build the library itself: +build tool first using the compiler you will use to build the library itself. + +On a typical setup, this will involve: ~~~ -c++ build.cc -o build -std=c++1z +c++ build.cc -o build -std=c++1z -I. -pthread +./build --help ~~~ -On Unix-like systems, the `-pthread` option is necessary. C++17 is required -to build it just like the library itself. If you're using libc++ and your -version does not supply a stable `std::filesystem` module, you will also -need to link `-lc++experimental`. If you have the same issue with libstdc++, -the necessary linker flag is `-lstdc++fs`. +This will typically build using either GCC or Clang with typically libstdc++ +as a standard library implementation. **Keep in mind that it is you need +at least Clang 4.0 or GCC 7.1 to build.** To switch to libc++: + +~~~ +c++ build.cc -o build -std=c++1z -I. -pthread -stdlib=libc++ +CXXFLAGS="-stdlib=libc++" ./build +~~~ + +If you get undefined references about filesystem, you will need to add +extra linkage. + +For libstdc++: + +~~~ +c++ build.cc -o build -std=c++1z -I. -pthread -lstdc++fs +LDFLAGS="-lstdc++fs" ./build +~~~ + +For libc++: + +~~~ +c++ build.cc -o build -std=c++1z -I. -pthread -stdlib=libc++ -lc++experimental +CXXFLAGS="-stdlib=libc++" LDFLAGS="-lc++experimental" ./build +~~~ + +You can skip `-pthread` on Windows. Using the tool should be straightforward. The `./build --help` command lists the available options.