-
Notifications
You must be signed in to change notification settings - Fork 73
/
BuildDependencies.cmake
89 lines (65 loc) · 1.8 KB
/
BuildDependencies.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
cmake_minimum_required(VERSION 3.19)
include(FetchContent)
set(absl_URL https://github.com/abseil/abseil-cpp.git)
set(absl_TAG 20240116.0)
set(re2_URL https://github.com/google/re2.git)
set(re2_TAG 2024-02-01)
set(gtest_URL https://github.com/google/googletest.git)
set(gtest_TAG v1.14.0)
# From https://www.antlr.org/download.html
set(antlr_cpp_URL https://www.antlr.org/download/antlr4-cpp-runtime-4.12.0-source.zip)
set(antlr_cpp_MD5 acf7371bd7562188712751266d8a7b90)
set(proto_URL https://github.com/protocolbuffers/protobuf.git)
set(proto_TAG v28.2)
set(nlohmann_json_URL https://github.com/nlohmann/json.git)
set(nlohmann_json_TAG v3.11.2)
if(POLICY CMP0135)
cmake_policy(SET CMP0135 NEW)
set(CMAKE_POLICY_DEFAULT_CMP0135 NEW)
endif()
FetchContent_Declare(
abseil-cpp
GIT_REPOSITORY ${absl_URL}
GIT_TAG ${absl_TAG}
)
FetchContent_Declare(
re2
GIT_REPOSITORY ${re2_URL}
GIT_TAG ${re2_TAG}
)
FetchContent_Declare(
googletest
GIT_REPOSITORY ${gtest_URL}
GIT_TAG ${gtest_TAG}
)
FetchContent_Declare(
antlr_cpp
URL ${antlr_cpp_URL}
URL_HASH MD5=${antlr_cpp_MD5}
)
if (FUZZTEST_BUILD_TESTING)
FetchContent_Declare(
protobuf
GIT_REPOSITORY ${proto_URL}
GIT_TAG ${proto_TAG}
)
FetchContent_Declare(
nlohmann_json
GIT_REPOSITORY ${nlohmann_json_URL}
GIT_TAG ${nlohmann_json_TAG}
)
endif ()
set(ABSL_PROPAGATE_CXX_STD ON)
set(ABSL_ENABLE_INSTALL ON)
FetchContent_MakeAvailable(abseil-cpp)
set(RE2_BUILD_TESTING OFF)
FetchContent_MakeAvailable(re2)
set(GTEST_HAS_ABSL ON)
FetchContent_MakeAvailable(googletest)
FetchContent_MakeAvailable(antlr_cpp)
if (FUZZTEST_BUILD_TESTING)
set(protobuf_BUILD_TESTS OFF)
set(protobuf_INSTALL OFF)
FetchContent_MakeAvailable(protobuf)
FetchContent_MakeAvailable(nlohmann_json)
endif ()