Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

Compiling

LennyPhoenix edited this page Jun 2, 2021 · 7 revisions
  • Clone the repository: git clone https://github.com/LennyPhoenix/GodotDiscordSDK.git

    • Update submodules:
    cd GodotDiscordSDK
    git submodule update --init --recursive --remote
  • Either:

    • Run the setup script:

      • Windows: setup.bat
      • Linux/OSX: ./setup.sh
    • Or manually setup:

      • Download the Discord Game SDK (2.5.6).

      • Copy the discord_game_sdk.h file from the c/ folder of the SDK, and place it in the src/ folder of the repo.

      • Place the discord_game_sdk.dll.lib file from the lib/x86 folder of the SDK in the lib/ of the repo and rename it to discord_game_sdk.32.lib.

        Do the same with the discord_game_sdk.dll.lib file from the lib/x86_64 folder, renaming it to discord_game_sdk.64.lib.

        The .lib files renamed correctly in the lib/ folder.

      • Make sure to place the appropriate Discord Game SDK shared library in the demo's bin directory (ensure it is also placed in any exports, this should be automatic if it is selected as a dependency).

        These files can be retrieved from the lib/x86 and lib/x86_64 folders of the SDK. (x86 being 32-Bit, and x86_64 being 64-Bit)

        The compiled bindings with the Discord Game SDK shared library.

        NOTE: On Linux/OSX you may have to add lib to the beginning of these shared library's names.

  • Install SCons: (If not already installed)

    • Download and install Python (Make sure to add to PATH)
    • Install SCons: python -m pip install -U scons
    • (Optional) Reload your terminal to update the path variables.
  • Compile the library:

    • Windows Example: scons platform=windows bits=64
  • The compiled binaries will be available from the demo's bin directory.

    NOTE: The output directory for the compiled binaries can be changed by passing the target_path parameter in scons, e.g scons platform=windows bits=64 target_path=project/bin

  • These may now be used in a GDNative library in your godot project. See the demo project for an example and Installation for more details.

Clone this wiki locally