Skip to content

Commit 3aee781

Browse files
authored
Merge pull request #250 from Atari2/master
Correct README.md
2 parents a1f1f21 + d8c0136 commit 3aee781

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,18 @@ If you'd rather not build from source, check out the [Releases](https://github.c
1414
Asar can also be built as a DLL. This makes it easier and faster to use in other programs (such as a sprite insertion tool). You can find documentation on the DLL API in the respective bindings (asardll.h, asar.cs, asar.py).
1515

1616
## Asar as a static library
17-
Asar can also be build as a static library. All "out-facing" functions are in interface-lib.h. This is useful for embedding Asar in other programs which don't want to use DLLs. The easiest way to add asar as a static library to your project, assuming you are using CMake (at least 3.11), is to use [FetchContent](https://cmake.org/cmake/help/latest/module/FetchContent.html) to fetch the source code, then add the following to your CMakeLists.txt:
17+
Asar can also be built as a static library. All "out-facing" functions are in interface-lib.h. This is useful for embedding Asar in other programs which don't want to use DLLs. The easiest way to add asar as a static library to your project is to add it as a git submodule
18+
19+
`git submodule add https://github.com/RPGHacker/asar <path-to-subdir>`
20+
21+
then add the following to your CMakeLists.txt:
1822
```CMake
19-
target_include_directories(YourTarget PUBLIC ${asar_SOURCE_DIR}/src)
23+
add_subdirectory(<path-to-subdir>/src)
24+
get_target_property(ASAR_INCLUDE_DIR asar-static INCLUDE_DIRECTORIES)
25+
include_directories(${ASAR_INCLUDE_DIR})
26+
target_link_libraries(YourTarget PUBLIC asar-static)
2027
```
21-
to be able to include the header files. It is also recommended to add `set(ASAR_TESTING_DISABLED TRUE)` to your CMakeLists.txt to disable building tests.
28+
to be able to include the header files. It is also recommended to turn off every build in target in asar except the static one using the appropriate CMake options. You will need to make sure that your project has an Asar compatible license.
2229

2330
## Folder layout
2431
* `docs` contains the source of the manual and changelog.

0 commit comments

Comments
 (0)