Skip to content

Building from Source

Michael Fabian Dirks edited this page May 29, 2020 · 5 revisions

Building from Source

libcaffeine comes in two flavors: prebuilt binaries, and raw source code. This page covers how to convert the latter into actual binaries.

Windows

Requirements

  • Windows 10 64bit (Windows 7 also works)
  • Git
  • CMake (most recent version)
  • Either:
  • 7-Zip or a 7z compatible Archiver

Steps (with helper script)

  1. Download compatible WebRTC binaries from here.
    curl -kL "<URL>" -f --retry 5 -o webrtc.7z
  2. Extract the downloaded WebRTC binaries to third_party/webrtc.
    7z -othird_party/webrtc x webrtc.7z
  3. Download compatible libCURL binaries from here.
    curl -kL "<URL>" -f --retry 5 -o obsdeps.zip
  4. Extract the downloaded libCURL binaries to third_party/obsdeps.
    7z -othird_party/obsdeps x obsdeps.zip
  5. Enter the scripts directory.
  6. Run win-build.bat and wait until all windows have disappeared.
  7. Open either the 32-bit solution at build32/libcaffeine.sln or 64-bit solution at build64/libcaffeine.sln. To rebuild both for changes, just run the win-build.bat again.

Steps (without helper script)

  1. Follow steps 1 to 4 from the above.
  2. To configure the project, run the following commands from the repository root:
    • If you are using Visual Studio 2019:
      cmake -H. -Bbuild32 -G "Visual Studio 16 2019" -A "Win32" -T "ClangCL" -D WEBRTC_ROOT_DIR="third_party/webrtc" -D DepsPath="third_party/obsdeps/win32" -D BUILD_TESTING=OFF -Dlibcaffeine_BuildTests=OFF
      cmake -H. -Bbuild64 -G "Visual Studio 16 2019" -A "x64" -T "ClangCL" -D WEBRTC_ROOT_DIR="third_party/webrtc" -D DepsPath="third_party/obsdeps/win64" -D BUILD_TESTING=OFF -Dlibcaffeine_BuildTests=OFF
    • If you are using Visual Studio 2017:
      cmake -H. -Bbuild32 -G "Visual Studio 15 2017 Win32" -T "LLVM" -D WEBRTC_ROOT_DIR="third_party/webrtc" -D DepsPath="third_party/obsdeps/win32" -D BUILD_TESTING=OFF -Dlibcaffeine_BuildTests=OFF
      cmake -H. -Bbuild64 -G "Visual Studio 15 2017 x64" -T "LLVM" -D WEBRTC_ROOT_DIR="third_party/webrtc" -D DepsPath="third_party/obsdeps/win64" -D BUILD_TESTING=OFF -Dlibcaffeine_BuildTests=OFF
  3. You can now find the solution file at build##/libcaffeine.sln.
  4. Run either of the following commands to build for a specific bitness in the repository root:
    • 32-bit: cmake --build build32 --config RelWithDebInfo
    • 64-bit: cmake --build build64 --config RelWithDebInfo
    • Or build within your Visual Studio IDE.

Clone this wiki locally