스킵 구현

This commit is contained in:
2023-12-20 19:45:25 +09:00
parent 6503fd167b
commit 8a987320e0
775 changed files with 162601 additions and 135 deletions

View File

@@ -0,0 +1,11 @@
\page install-from-source Building D++ from Source
The way you build D++ varies from system to system. Please follow the guide below for your OS:
* \subpage buildlinux
* \subpage buildwindows
* \subpage buildosx
* \subpage buildfreebsd
* \subpage buildopenbsd
\warning Note that you most likely don't need to build D++ from source if you're on Linux or Windows. We offer prebuilt binaries for these platforms and are listed in package managers! Check the downloads in the releases section on GitHub.

View File

@@ -0,0 +1,75 @@
\page buildfreebsd Building on FreeBSD
\note This page assumes you are the root user. If you are not, start the package install commands with `sudo`, along with `make install`. You will need `sudo` installed if you are not the root user.
## 1. Toolchain
Since the project uses `CMake`, you'll need to install it! If you don't have it, you can do the following:
```bash
pkg install cmake
```
## 2. Install Voice Dependencies (Optional)
If you wish to use voice support, you'll need to install opus and libsodium:
First, you need to install opus.
```bash
cd /usr/ports/audio/opus
make && make install
```
Then, you need to install libsodium.
```bash
cd /usr/ports/security/libsodium
make && make install
```
## 3. Build Source Code
```bash
cmake -B ./build
cmake --build ./build -j8
```
Replace the number after `-j` with a number suitable for your setup, usually the same as the number of cores on your machine. `cmake` will fetch any dependencies that are required for you and ensure they are compiled alongside the library.
## 4. Install Globally
```bash
cd build
make install
```
## 5. Installation to a Different Directory (Optional)
If you want to install the library, its dependencies and header files to a different directory, specify this directory when running `cmake`:
```bash
cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/install
```
Then once the build is complete, run `sudo make install` to install to the location you specified.
## 6. Using the Library
Once installed, you can make use of the library in standalone programs simply by including it and linking to it:
```bash
clang++ -std=c++17 -L/usr/local/lib -I/usr/local/include -ldpp bot.cpp -o dppbot
```
The important flags in this command-line are:
* `-std=c++17` - Required to compile the headers
* `-L/usr/local/lib` - Required to tell the linker where libdpp is located.
* `-I/usr/local/include` - Required to tell the linker where dpp headers are located.
* `-ldpp` - Link to `libdpp.so`.
* `bot.cpp` - Your source code.
* `-o dppbot` - The name of the executable to make.
\include{doc} install_prebuilt_footer.dox
**Have fun!**

View File

@@ -0,0 +1,48 @@
\page buildlinux Building on Linux
\note You might not need to build a copy of the library for Linux - precompiled deb files for 64 bit and 32 bit Debian and Ubuntu are provided in the GitHub version releases. Unless you are on a different Linux distribution which does not support the installation of deb files, or wish to submit fixes and enhancements to the library itself you should have an easier time installing the precompiled version instead.
## 1. Build Source Code
```bash
cmake -B ./build
cmake --build ./build -j8
```
Replace the number after `-j` with a number suitable for your setup, usually the same as the number of cores on your machine. `cmake` will fetch any dependencies that are required for you and ensure they are compiled alongside the library.
## 2. Install to /usr/local/include and /usr/local/lib
```bash
cd build
sudo make install
```
## 3. Installation to a Different Directory
If you want to install the library, its dependencies, and header files to a different directory, specify this directory when running `cmake`:
```bash
cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/install
```
Then once the build is complete, run `make install` to install to the location you specified.
## 4. Using the Library
Once installed to the `/usr/local` directory, you can make use of the library in standalone programs simply by including it and linking to it:
```bash
g++ -std=c++17 mydppbot.cpp -o dppbot -ldpp
```
The important flags in this command-line are:
* `-std=c++17` - Required to compile the headers
* `-ldpp` - Link to libdpp.so
* `mydppbot.cpp` - Your source code
* `dppbot` - The name of the executable to make
\include{doc} install_prebuilt_footer.dox
**Have fun!**

View File

@@ -0,0 +1,50 @@
\page buildopenbsd Building on OpenBSD
\note This page assumes you are the root user. If you are not, start the package install commands with `doas`, along with `make install`.
## 1. Toolchain
Since the project uses `CMake`, you'll need to install it! If you don't have it, you can do the following:
```bash
pkg_add cmake
```
## 2. Install Voice Dependencies (Optional)
If you wish to use voice support, you'll need to do the following:
```bash
pkg_add libsodium opus pkgconf
```
## 3. Build Source Code
```bash
cmake -B ./build
cmake --build ./build -j8
```
Replace the number after `-j` with a number suitable for your setup, usually the same as the number of cores on your machine. `cmake` will fetch any dependencies that are required for you and ensure they are compiled alongside the library.
## 4. Install Globally
```bash
cd build; make install
```
## 5. Installation to a Different Directory
If you want to install the library, its dependencies and header files to a different directory, specify this directory when running `cmake`:
```bash
cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/install
```
Then once the build is complete, run `make install` to install to the location you specified.
## 6. Using the Library
Once installed to the `/usr/local` directory, you can make use of the library in CMake, without linking to a folder! You can't use this with `clang++`, nor `g++`, as OpenBSD seems to be broken on this end, so your only option from here is to use CMake. This isn't a bad thing, as we recommend people to use CMake anyways!
**Have fun!**

View File

@@ -0,0 +1,67 @@
\page buildosx Building on OSX
## 1. Toolchain
Before compiling make sure you have all the tools installed.
1. To install the dependencies, this guide will use Homebrew which has an [installation guide on their project page](https://brew.sh/).
2. This project uses CMake to generate the makefiles. Install it with `brew install cmake`.
## 2. Install External Dependencies
```bash
brew install openssl pkgconfig
```
\note Usually, you do not need pkgconfig. However, it seems that it throws errors about openssl without.
For voice support, additional dependencies are required:
```bash
brew install libsodium opus
```
## 3. Build Source Code
```bash
cmake -B ./build
cmake --build ./build -j8
```
Replace the number after `-j` with a number suitable for your setup, usually the same as the number of cores on your machine. `cmake` will fetch any dependencies that are required for you and ensure they are compiled alongside the library.
## 4. Install Globally
```bash
cd build
sudo make install
```
## 5. Installation to a Different Directory
If you want to install the library, its dependencies, and header files to a different directory, specify this directory when running `cmake`:
```bash
cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/install
```
Then once the build is complete, run `sudo make install` to install to the location you specified.
## 6. Using the Library
Once installed, you can make use of the library in standalone programs simply by including it and linking to it:
```bash
clang++ -std=c++17 -ldpp mydppbot.cpp -o dppbot
```
The important flags in this command-line are:
* `-std=c++17` - Required to compile the headers
* `-ldpp` - Link to libdpp.dylib
* `mydppbot.cpp` - Your source code
* `dppbot` - The name of the executable to make
\include{doc} install_prebuilt_footer.dox
**Have fun!**

View File

@@ -0,0 +1,30 @@
\page buildwindows Building on Windows
To build on Windows follow these steps *exactly*. The build process depends on specific libraries being installed on your system in specific locations.
## Wait a minute! Read this first!
\warning **You do not need to follow this tutorial unless you plan to contribute to or modify the library itself**. Unless you consider yourself an **advanced user** with a specific **requirement to build from source** you should [obtain a pre-made Visual Studio template containing the latest D++ build (for 32 and 64 bit, release and debug profiles) by clicking here](https://github.com/brainboxdotcc/windows-bot-template/) and completely skip this guide! Instead, read \ref build-a-discord-bot-windows-visual-studio.
## If you are absolutely sure you need this guide, read on:
1. Make sure you have Visual Studio 2019 or Visual Studio 2022. The Community, Professional or Enterprise versions all work, however you will probably want to install Community. You do **NOT** want to use *Visual Studio Code* for this. You can [download the correct version here](https://visualstudio.microsoft.com/downloads/).
2. Check out the D++ project source using Git
3. From within Visual Studio 2019, click the "File" menu, choose "Open" then "CMake", and select the `CMakeLists.txt` within the project folder
\image html winbuild_1.png
\image html winbuild_2.png
4. Go to the "Build" menu and choose "Build all" or just press F7
\image html winbuild_3.png
5. Check that compilation succeeded. You may now use the library in your projects!
\image html winbuild_4.png
## Troubleshooting
* If you do not have an option to open the `CMakeLists.txt`, ensure that you have installed the C++ development portions of Visual Studio (not just web development portions) with at least the default options.
* If the project does not build, please ask for help on the [official Discord server](https://discord.gg/dpp).
## After compiling
After compilation you can directly reference the compiled project in your own `CMakeLists.txt` as a library or use the `lib/dll/headers` as you wish. Note that `openssl` and `zlib` will also be an indirect dependency of your program (as `DLL` files) and should be copied alongside `dpp.dll`.
**Have fun!**