Debian Codegraph @

cmake/ExperimentalFeatures.cmake

raw
1 # Experimental feature support for libgit2 - developers can opt in to
2 # experimental functionality, like sha256 support. When experimental
3 # functionality is enabled, we set both a cmake flag *and* a compile
4 # definition. The cmake flag is used to generate `experimental.h`,
5 # which will be installed by a `make install`. But the compile definition
6 # is used by the libgit2 sources to detect the functionality at library
7 # build time. This allows us to have an in-tree `experimental.h` with
8 # *no* experiments enabled. This lets us support users who build without
9 # cmake and cannot generate the `experimental.h` file.
10
11 if(EXPERIMENTAL_SHA256)
12 add_feature_info("SHA256 API" ON "experimental SHA256 APIs")
13
14 set(EXPERIMENTAL 1)
15 set(GIT_EXPERIMENTAL_SHA256 1)
16 add_definitions(-DGIT_EXPERIMENTAL_SHA256=1)
17 else()
18 add_feature_info("SHA256 API" OFF "experimental SHA256 APIs")
19 endif()
20
21 if(EXPERIMENTAL)
22 set(LIBGIT2_FILENAME "${LIBGIT2_FILENAME}-experimental")
23 endif()