lol
1diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
2index dab2aaef..26b587b1 100644
3--- a/lib/CMakeLists.txt
4+++ b/lib/CMakeLists.txt
5@@ -36,7 +36,7 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
6 endif()
7
8 ExternalProject_Add(gbenchmark
9- URL ${PONYC_GBENCHMARK_URL}
10+ SOURCE_DIR gbenchmark-prefix/src/benchmark
11 CMAKE_ARGS -DCMAKE_BUILD_TYPE=${PONYC_LIBS_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DBENCHMARK_ENABLE_GTEST_TESTS=OFF -DCMAKE_CXX_FLAGS=${PONY_PIC_FLAG} --no-warn-unused-cli
12 )
13
14@@ -46,7 +46,7 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
15 endif()
16
17 ExternalProject_Add(googletest
18- URL ${PONYC_GOOGLETEST_URL}
19+ URL @googletest@
20 CMAKE_ARGS -DCMAKE_BUILD_TYPE=${PONYC_LIBS_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DCMAKE_CXX_FLAGS=${PONY_PIC_FLAG} -Dgtest_force_shared_crt=ON --no-warn-unused-cli
21 )
22
23@@ -59,82 +59,6 @@ install(TARGETS blake2
24 COMPONENT library
25 )
26
27-find_package(Git)
28-
29-set(LLVM_DESIRED_HASH "75e33f71c2dae584b13a7d1186ae0a038ba98838")
30-set(PATCHES_DESIRED_HASH "a16f299fbfced16a2bbc628746db341f2a5af9ae8cc9c9ef4b1e9ca26de3c292")
31-
32-if(GIT_FOUND)
33- if(EXISTS "${PROJECT_SOURCE_DIR}/../.git")
34- # Update submodules as needed
35- option(GIT_SUBMODULE "Check submodules during build" ON)
36- if(GIT_SUBMODULE)
37- message(STATUS "Updating submodules...")
38- execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive --depth 1
39- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
40- RESULT_VARIABLE git_submod_result)
41- #message("git_submod_result ${git_submod_result}")
42- if(NOT git_submod_result EQUAL "0")
43- message(FATAL_ERROR "git submodule update --init --recursive --depth 1 failed with ${git_submod_result}, please checkout submodules")
44- endif()
45-
46- # we check to make sure the submodule hash matches
47- # the reason the submodule hash is in this file is to be able to use this file as a key for caching the libs in CI
48- execute_process(COMMAND ${GIT_EXECUTABLE} submodule status
49- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
50- OUTPUT_VARIABLE git_submod_output)
51- #message("git_submod_output ${git_submod_output}")
52- string(FIND "${git_submod_output}" "${LLVM_DESIRED_HASH}" LLVM_SUBMOD_POS)
53- if(LLVM_SUBMOD_POS EQUAL "-1")
54- message(FATAL_ERROR "Expecting the lib/llvm/src submodule to be at hash '${LLVM_DESIRED_HASH}'; found '${git_submod_output}'; update the LLVM_DESIRED_HASH variable in lib/CMakeLists.txt if you've updated the submodule.")
55- endif()
56- endif()
57- endif()
58-
59- # Apply patches
60- message("Applying patches...")
61- file(GLOB PONY_LLVM_PATCHES "${PROJECT_SOURCE_DIR}/llvm/patches/*.diff")
62-
63- # check to see if the patch hashes match
64- message("Checking patches ${PONY_LLVM_PATCHES}")
65- set(PATCHES_ACTUAL_HASH "needed_if_no_patches")
66- foreach (PATCH ${PONY_LLVM_PATCHES})
67- file(STRINGS ${PATCH} patch_file NEWLINE_CONSUME)
68- string(REPLACE "\n" " " patch_file ${patch_file})
69- string(SHA256 patch_file_hash ${patch_file})
70- # message("${PATCH}: '${patch_file_hash}'")
71- string(CONCAT PATCHES_ACTUAL_HASH ${PATCHES_ACTUAL_HASH} ${patch_file_hash})
72- # message("concat is '${PATCHES_ACTUAL_HASH}'")
73- endforeach()
74- string(SHA256 PATCHES_ACTUAL_HASH ${PATCHES_ACTUAL_HASH})
75- # message("Desired hash ${PATCHES_DESIRED_HASH}")
76- # message("Actual hash ${PATCHES_ACTUAL_HASH}")
77- if(NOT PATCHES_ACTUAL_HASH MATCHES "${PATCHES_DESIRED_HASH}")
78- message(FATAL_ERROR "Patch hash actual '${PATCHES_ACTUAL_HASH}' does not match desired '${PATCHES_DESIRED_HASH}'")
79- endif()
80-
81- foreach (PATCH ${PONY_LLVM_PATCHES})
82- message(" Checking ${PATCH}")
83- execute_process(COMMAND ${GIT_EXECUTABLE} apply --check -p 1 --ignore-whitespace --whitespace=nowarn ${PATCH}
84- WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/llvm/src"
85- ERROR_VARIABLE _err_out
86- RESULT_VARIABLE git_apply_check_result)
87- if(git_apply_check_result EQUAL "0")
88- message(" Applying ${PATCH}")
89- execute_process(COMMAND ${GIT_EXECUTABLE} apply -p 1 --ignore-whitespace --whitespace=nowarn ${PATCH}
90- WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/llvm/src"
91- RESULT_VARIABLE git_apply_result)
92- if(NOT git_apply_result EQUAL "0")
93- message(FATAL_ERROR "Unable to apply ${PATCH}")
94- endif()
95- else()
96- message(" Already applied ${PATCH}")
97- endif()
98- endforeach()
99-else()
100- message(FATAL_ERROR "Git not found!")
101-endif()
102-
103 message("Building targets: ${LLVM_TARGETS_TO_BUILD}")
104
105 set(LLVM_ENABLE_BINDINGS OFF)