CMake: Add option EVMC_TEST_TOOLS

This will build evmc-vmtester but without bothering with unit tests. This option implies build examples because they are needed for vmtester.
This commit is contained in:
Paweł Bylica 2019-03-14 17:37:26 +01:00
parent 645c550358
commit 3c1427fe7c
No known key found for this signature in database
GPG Key ID: 7A0C037434FE77EF
2 changed files with 18 additions and 8 deletions

View File

@ -9,9 +9,13 @@ if(TARGET evmc)
return() return()
endif() endif()
option(EVMC_TESTING "Build EVMC tests and test tools" OFF) option(EVMC_TESTING "Build EVMC examples, tests and test tools (i.e. everything)" OFF)
option(EVMC_EXAMPLES "Build EVMC examples" ${EVMC_TESTING}) option(EVMC_TEST_TOOLS "Build EVMC test tools" ${EVMC_TESTING})
option(HUNTER_ENABLED "Enable Hunter package manager support" "${EVMC_TESTING}") if(EVMC_TESTING OR EVMC_TEST_TOOLS)
set(hunter_and_examples_required TRUE)
endif()
option(EVMC_EXAMPLES "Build EVMC examples" ${hunter_and_examples_required})
option(HUNTER_ENABLED "Enable Hunter package manager support" ${hunter_and_examples_required})
include(cmake/cable/bootstrap.cmake) include(cmake/cable/bootstrap.cmake)
include(CableBuildType) include(CableBuildType)
@ -20,7 +24,7 @@ include(CableToolchains)
include(CMakePackageConfigHelpers) include(CMakePackageConfigHelpers)
include(GNUInstallDirs) include(GNUInstallDirs)
if(EVMC_TESTING) if(HUNTER_ENABLED)
set(HUNTER_CONFIGURATION_TYPES Release CACHE STRING "Build type of Hunter packages") set(HUNTER_CONFIGURATION_TYPES Release CACHE STRING "Build type of Hunter packages")
include(HunterGate) include(HunterGate)
include(HunterConfig) include(HunterConfig)
@ -49,10 +53,13 @@ add_subdirectory(lib)
if(EVMC_TESTING) if(EVMC_TESTING)
enable_testing() enable_testing()
endif()
if(EVMC_TESTING OR EVMC_TEST_TOOLS)
add_subdirectory(test) add_subdirectory(test)
endif() endif()
if(EVMC_EXAMPLES OR EVMC_TESTING) if(EVMC_TESTING OR EVMC_EXAMPLES)
add_subdirectory(examples) add_subdirectory(examples)
endif() endif()

View File

@ -1,6 +1,6 @@
# EVMC: Ethereum Client-VM Connector API. # EVMC: Ethereum Client-VM Connector API.
# Copyright 2019 The EVMC Authors. # Copyright 2019 The EVMC Authors.
# Licensed under the Apache License, Version 2.0. See the LICENSE file. # Licensed under the Apache License, Version 2.0.
hunter_add_package(GTest) hunter_add_package(GTest)
find_package(GTest CONFIG REQUIRED) find_package(GTest CONFIG REQUIRED)
@ -11,6 +11,9 @@ if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_C_EXTENSIONS OFF) set(CMAKE_C_EXTENSIONS OFF)
endif() endif()
add_subdirectory(integration) if(EVMC_TESTING)
add_subdirectory(unittests) add_subdirectory(integration)
add_subdirectory(unittests)
endif()
add_subdirectory(vmtester) add_subdirectory(vmtester)