obs-studio/libobs/obsconfig.h.in
PatTheMav 2966c4030e libobs: Use static library for version string information
Switching to a static library that contains version information as
const char strings has multiple benefits:

* The version information provided externally via compiler definitions
  will fail compilation early if malformed
* An updated version string (which will happen with every commit) will
  not invalidate existing compilation units, because only the static
  library is affected by the change
* An update of the version change just requires a recompilation of the
  static library and a linker update
* An update of the version will _not_ infect the rest of the codebase
  (as it does currently, because everything includes obsconfig.h one
  way or another)
* Other modules which used the macro definition directly have been
  updated as much as possible to use the proper getter method from
  `libobs` instead (some Windows-specific modules use preprocessor
  string composition, the value has been added as a compiler definition
  directly in those cases)
* Because the impact of a version change due to a commit hash change
  is limited to the static library, ccache hit rates should be
  improved considerably
2023-05-27 16:48:24 -07:00

38 lines
1.5 KiB
C

#pragma once
#cmakedefine OBS_DATA_PATH "@OBS_DATA_PATH@"
#cmakedefine OBS_PLUGIN_PATH "@OBS_PLUGIN_PATH@"
#cmakedefine OBS_PLUGIN_DESTINATION "@OBS_PLUGIN_DESTINATION@"
#cmakedefine GIO_FOUND
#cmakedefine PULSEAUDIO_FOUND
#cmakedefine XCB_XINPUT_FOUND
#cmakedefine ENABLE_WAYLAND
/* NOTE: Release candidate version numbers internally are always the previous
* main release number! For example, if the current public release is 21.0 and
* the build is 22.0 release candidate 1, internally the build number (defined
* by LIBOBS_API_VER/etc) will always be 21.0, despite the OBS_VERSION string
* saying "22.0 RC1".
*
* If the release candidate version number is 0.0.0 and the RC number is 0,
* that means it's not a release candidate build. */
#define OBS_RELEASE_CANDIDATE_MAJOR @OBS_RELEASE_CANDIDATE_MAJOR@
#define OBS_RELEASE_CANDIDATE_MINOR @OBS_RELEASE_CANDIDATE_MINOR@
#define OBS_RELEASE_CANDIDATE_PATCH @OBS_RELEASE_CANDIDATE_PATCH@
#define OBS_RELEASE_CANDIDATE_VER \
MAKE_SEMANTIC_VERSION(OBS_RELEASE_CANDIDATE_MAJOR, \
OBS_RELEASE_CANDIDATE_MINOR, \
OBS_RELEASE_CANDIDATE_PATCH)
#define OBS_RELEASE_CANDIDATE @OBS_RELEASE_CANDIDATE@
/* Same thing for beta builds */
#define OBS_BETA_MAJOR @OBS_BETA_MAJOR@
#define OBS_BETA_MINOR @OBS_BETA_MINOR@
#define OBS_BETA_PATCH @OBS_BETA_PATCH@
#define OBS_BETA_VER \
MAKE_SEMANTIC_VERSION(OBS_BETA_MAJOR, \
OBS_BETA_MINOR, \
OBS_BETA_PATCH)
#define OBS_BETA @OBS_BETA@