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
Copy file name to clipboardExpand all lines: README.md
+40-17Lines changed: 40 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,30 +12,53 @@ been maintained over the course of several years by the open source Battle.net c
12
12
## Usage
13
13
Add `bncsutil.h` to your include directory and link against `bncsutil.lib` or `libbncsutil.so`.
14
14
15
-
## Building
16
-
CMake is used to generate platform specific build files. The only external dependency is GMP (The GNU Multiple Precision Arithmetic Library ).
17
-
It can be installed with a package manager from any major Linux distro. Debian example: `sudo apt-get install libgmp10`. To force a specific build (32bit or 64bit) build add `-DBUILD_32=1` or `-DBUILD_64=1` to CMake flags. CMake will not warn you if you are missing 32bit glibc and GMP, you must install them manually first (CentOS/Fedora: `glibc-devel.i686` and `gmp-devel.i686`).
15
+
## Building with conan and CMake
16
+
Conan will automatically install mpir on Windows and gmp on non-Windows platforms.
18
17
19
-
### Windows
18
+
To force a specific build (32bit or 64bit) add `-DCMAKE_GENERATOR_PLATFORM=x86` or `-DCMAKE_GENERATOR_PLATFORM=x64` to CMake flags.
20
19
21
-
#### GMP
22
-
If you are using an older toolchain like VS 2005 or 2008, the GMP lib and header file are already included for you in `depends/include` and `depends/lib`. You can skip this step.
23
-
For newer versions of Visual Studio we recommend to use MPIR library instead which is a drop-in replacement for GMP with better Windows support.
24
-
1. Go to http://mpir.org/ and download the latest source archive.
25
-
2. Open the VS solution file depending on which version you use, for example build.vc14 for VS 2015.
26
-
3. Make a Release build of `lib_mpir_gc` project. This produces `mpir.lib` and `mpir.h` in `build.vc14\lib_mpir_gc\Win32\Release`. Copy the header file to `depends/include` and library to `depends/lib`.
20
+
### Windows Visual Studio 2019
27
21
28
-
#### VS build
29
-
1. In root bncsutil folder run `cmake -G "Visual Studio 14 2015" -B./build -H./` if you used GMP or `cmake -G "Visual Studio 14 2015" -B./build -H./ -DUSE_MPIR=1` if you used MPIR in previous step. Change the Visual Studio version as needed.
30
-
2. CMake will generate sln file in ./build. Open it and build the library.
cmake -G "Visual Studio 14 2015" -B./build -DBUILD_SHARED_LIBS=1 -DCMAKE_GENERATOR_PLATFORM=x64
40
+
```
41
+
42
+
43
+
Open `.sln` in `build` directory and build from Visual Studio.
31
44
32
45
### Linux
33
-
1. Install GMP with the package manager. Also install all the necessary development tools (gcc, make or build-essential package on Debian).
34
-
2. Run `cmake -G "Unix Makefiles" -B./build -H./`
35
-
3.`cd build && make && make install`
46
+
```
47
+
conan install . -if ./build
48
+
cmake -G "Unix Makefiles" -B./build
49
+
cd build && make && make install
50
+
```
51
+
52
+
## Building using system dependencies
53
+
Instead of using conan you can link against system provided gmp. Install `libgmp-dev` on deb distros or `gmp-devel` on rpm distros. For 32bit builds, CMake will not warn you if you are missing 32bit glibc and GMP, you must install them manually first (CentOS/Fedora: `glibc-devel.i686` and `gmp-devel.i686`).
54
+
55
+
```
56
+
cmake -G "Unix Makefiles" -B./build
57
+
cd build && make && make install
58
+
```
36
59
37
60
## Building .deb and .rpm packages
38
-
After invoking cmake, cd to build folder and generate them with `cpack -G "DEB"` and `cpack -G "RPM"`.
61
+
After invoking CMake, cd to build folder and generate them with `cpack -G "DEB"` and `cpack -G "RPM"`.
39
62
You can then use `gdebi` to do a local install of .deb with automatic dependency resolution or `yum localinstall` on rpm distros. For dnf it's just `dnf install <name>.rpm`.
0 commit comments