-
-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
104 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,27 +24,49 @@ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake) | |
|
||
option(ADA_BENCHMARKS "Build benchmarks" OFF) | ||
|
||
include(cmake/CPM.cmake) | ||
# CPM requires git as an implicit dependency | ||
find_package(Git QUIET) | ||
# We use Google Benchmark, but it does not build under several 32-bit systems. | ||
if((BUILD_TESTING OR ADA_BENCHMARKS) AND (CMAKE_SIZEOF_VOID_P EQUAL 8)) | ||
include(${PROJECT_SOURCE_DIR}/cmake/import.cmake) | ||
import_dependency(simdjson simdjson/simdjson 14d927128ba14e13913fc0e7c2cf538790bd1622) | ||
add_dependency(simdjson) | ||
import_dependency(gtest google/googletest 797b0ad2a3a45608ecf5c67e6e289d377a3521ca) | ||
add_dependency(gtest) | ||
if(Git_FOUND AND (BUILD_TESTING OR ADA_BENCHMARKS) AND (CMAKE_SIZEOF_VOID_P EQUAL 8)) | ||
CPMAddPackage("gh:simdjson/[email protected]") | ||
CPMAddPackage( | ||
NAME GTest | ||
GITHUB_REPOSITORY google/googletest | ||
VERSION 1.14.0 | ||
OPTIONS "BUILD_GMOCK OFF" "INSTALL_GTEST OFF" | ||
) | ||
CPMAddPackage( | ||
NAME benchmark | ||
GITHUB_REPOSITORY google/benchmark | ||
GIT_TAG f91b6b4 | ||
OPTIONS "BENCHMARK_ENABLE_TESTING OFF" | ||
"BENCHMARK_ENABLE_INSTALL OFF" | ||
"BENCHMARK_ENABLE_WERROR OFF" | ||
|
||
) | ||
endif() | ||
|
||
if (BUILD_TESTING AND NOT EMSCRIPTEN) | ||
message(STATUS "The tests are enabled.") | ||
add_subdirectory(tests) | ||
if(Git_FOUND) | ||
message(STATUS "The tests are enabled.") | ||
add_subdirectory(tests) | ||
else() | ||
message(STATUS "The tests are disabled because git was not found.") | ||
endif() | ||
else() | ||
if(is_top_project) | ||
message(STATUS "The tests are disabled.") | ||
endif() | ||
endif(BUILD_TESTING AND NOT EMSCRIPTEN) | ||
|
||
If(ADA_BENCHMARKS AND NOT EMSCRIPTEN) | ||
message(STATUS "Ada benchmarks enabled.") | ||
add_subdirectory(benchmarks) | ||
if(Git_FOUND) | ||
message(STATUS "Ada benchmarks enabled.") | ||
add_subdirectory(benchmarks) | ||
else() | ||
message(STATUS "The benchmarks are disabled because git was not found.") | ||
endif() | ||
else(ADA_BENCHMARKS AND NOT EMSCRIPTEN) | ||
if(is_top_project) | ||
message(STATUS "Ada benchmarks disabled. Set ADA_BENCHMARKS=ON to enable them.") | ||
|
@@ -72,7 +94,11 @@ if(NOT ADA_COVERAGE AND NOT EMSCRIPTEN) | |
endif() | ||
|
||
if(ADA_TOOLS) | ||
add_subdirectory(tools) | ||
if(Git_FOUND) | ||
add_subdirectory(tools) | ||
else() | ||
message(STATUS "The tools are disabled because git was not found.") | ||
endif() | ||
endif() | ||
|
||
install( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# SPDX-License-Identifier: MIT | ||
# | ||
# SPDX-FileCopyrightText: Copyright (c) 2019-2023 Lars Melchior and contributors | ||
|
||
set(CPM_DOWNLOAD_VERSION 0.38.6) | ||
set(CPM_HASH_SUM "11c3fa5f1ba14f15d31c2fb63dbc8628ee133d81c8d764caad9a8db9e0bacb07") | ||
|
||
if(CPM_SOURCE_CACHE) | ||
set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") | ||
elseif(DEFINED ENV{CPM_SOURCE_CACHE}) | ||
set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") | ||
else() | ||
set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake") | ||
endif() | ||
|
||
# Expand relative path. This is important if the provided path contains a tilde (~) | ||
get_filename_component(CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE) | ||
|
||
file(DOWNLOAD | ||
https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake | ||
${CPM_DOWNLOAD_LOCATION} EXPECTED_HASH SHA256=${CPM_HASH_SUM} | ||
) | ||
|
||
include(${CPM_DOWNLOAD_LOCATION}) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters