clearer readme

master
Daniel Kolesa 2017-06-19 17:09:30 +02:00
parent 146da105b9
commit c6a854fac3
1 changed files with 32 additions and 7 deletions

View File

@ -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.