You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you like CMake, you can just a few lines in you `CMakeLists.txt` file to grab a `CRoaring` release. [See our demonstration for further details](https://github.com/RoaringBitmap/croaring_cmake_demo_single_file).
@@ -103,74 +180,27 @@ target_link_libraries(repro PUBLIC roaring::roaring)
103
180
```
104
181
105
182
106
-
# Amalgamation/Unity Build
107
-
108
-
The CRoaring library can be amalgamated into a single source file that makes it easier
109
-
for integration into other projects. Moreover, by making it possible to compile
110
-
all the critical code into one compilation unit, it can improve the performance. For
111
-
the rationale, please see the SQLite documentation, https://www.sqlite.org/amalgamation.html,
112
-
or the corresponding Wikipedia entry (https://en.wikipedia.org/wiki/Single_Compilation_Unit).
113
-
Users who choose this route, do not need to rely on CRoaring's build system (based on CMake).
114
-
115
-
We maintain pre-generated amalgamated files at https://github.com/lemire/CRoaringUnityBuild for your convenience.
183
+
# Amalgamating
116
184
117
185
To generate the amalgamated files yourself, you can invoke a bash script...
118
186
119
187
```bash
120
188
./amalgamation.sh
121
189
```
122
190
123
-
(Bash shells are standard under Linux and macOS. Bash shells are available under Windows as part of the [GitHub Desktop](https://desktop.github.com/) under the name ``Git Shell``. So if you have cloned the ``CRoaring`` GitHub repository from within the GitHub Desktop, you can right-click on ``CRoaring``, select ``Git Shell`` and then enter the above commands.)
124
-
125
-
It is not necessary to invoke the script in the CRoaring directory. You can invoke
126
-
it from any directory where you want the amalgamation files to be written.
127
-
128
-
It will generate three files for C users: ``roaring.h``, ``roaring.c`` and ``amalgamation_demo.c``... as well as some brief instructions. The ``amalgamation_demo.c`` file is a short example, whereas ``roaring.h`` and ``roaring.c`` are "amalgamated" files (including all source and header files for the project). This means that you can simply copy the files ``roaring.h`` and ``roaring.c`` into your project and be ready to go! No need to produce a library! See the ``amalgamation_demo.c`` file.
191
+
If you prefer a silent output, you can use the following command to redirect ``stdout`` :
129
192
130
-
For example, you can use the C code as follows:
131
-
```C++
132
-
#include<stdio.h>
133
-
#include"roaring.c"
134
-
intmain() {
135
-
roaring_bitmap_t *r1 = roaring_bitmap_create();
136
-
for (uint32_t i = 100; i < 1000; i++) roaring_bitmap_add(r1, i);
(Bash shells are standard under Linux and macOS. Bash shells are available under Windows as part of the [GitHub Desktop](https://desktop.github.com/) under the name ``Git Shell``. So if you have cloned the ``CRoaring`` GitHub repository from within the GitHub Desktop, you can right-click on ``CRoaring``, select ``Git Shell`` and then enter the above commands.)
168
199
169
-
If you prefer a silent output, you can use the following command to redirect ``stdout`` :
200
+
It is not necessary to invoke the script in the CRoaring directory. You can invoke
201
+
it from any directory where you want the amalgamation files to be written.
170
202
171
-
```bash
172
-
./amalgamation.sh > /dev/null
173
-
```
203
+
It will generate three files for C users: ``roaring.h``, ``roaring.c`` and ``amalgamation_demo.c``... as well as some brief instructions. The ``amalgamation_demo.c`` file is a short example, whereas ``roaring.h`` and ``roaring.c`` are "amalgamated" files (including all source and header files for the project). This means that you can simply copy the files ``roaring.h`` and ``roaring.c`` into your project and be ready to go! No need to produce a library! See the ``amalgamation_demo.c`` file.
0 commit comments