mirror of
https://git.planet-casio.com/Lephenixnoir/OpenLibm.git
synced 2024-12-28 04:23:41 +01:00
add CMake instructions in the README
This commit is contained in:
parent
22428cc5d2
commit
07a9090c98
1 changed files with 21 additions and 4 deletions
25
README.md
25
README.md
|
@ -30,11 +30,28 @@ You can then build and install the static `libopenlibm.a` archive and the header
|
||||||
% make USEGCC=1 TOOLPREFIX=sh-elf- libdir="$PREFIX" includedir="$PREFIX/include" install-static install-headers
|
% make USEGCC=1 TOOLPREFIX=sh-elf- libdir="$PREFIX" includedir="$PREFIX/include" install-static install-headers
|
||||||
```
|
```
|
||||||
|
|
||||||
## Using in a program
|
## Using in a Makefile-based add-in
|
||||||
|
|
||||||
Simply link with `-lopenlibm` as you would do with `-lm`.
|
Link with `-lopenlibm` as you would do with `-lm`. Since OpenLibm headers
|
||||||
|
reference themselves by file name (`#include <openlibm_complex.h>`) even though
|
||||||
|
they are installed in a subfolder, you need a `-I` flag:
|
||||||
|
|
||||||
|
```
|
||||||
|
CFLAGS += -I $(shell sh-elf-gcc -print-file-name=include/openlibm)
|
||||||
|
LDFLAGS += -lopenlibm
|
||||||
|
```
|
||||||
|
|
||||||
|
## Using in a CMake-based add-in
|
||||||
|
|
||||||
|
When using CMake with the fxSDK, add the include folder and library like this.
|
||||||
|
|
||||||
|
```
|
||||||
|
target_include_directories(<TARGET> PRIVATE "${FXSDK_COMPILER_INSTALL}/include/openlibm")
|
||||||
|
target_link_libraries(<TARGET> -lopenlibm)
|
||||||
|
```
|
||||||
|
|
||||||
## README and Licensing
|
## README and Licensing
|
||||||
|
|
||||||
See the original README file in README-OpenLibm.md. OpenLibm contains code
|
See the original README file in [README-OpenLibm.md](README-OpenLibm.md).
|
||||||
covered by various licenses, see LICENSE.md.
|
OpenLibm contains code covered by various licenses, see
|
||||||
|
[LICENSE.md](LICENSE.md).
|
||||||
|
|
Loading…
Reference in a new issue