diff --git a/.ci/cmake.bat b/.ci/cmake.bat new file mode 100644 index 00000000..a3dc43df --- /dev/null +++ b/.ci/cmake.bat @@ -0,0 +1,9 @@ + +if "Visual Studio 2017"=="%APPVEYOR_BUILD_WORKER_IMAGE%" goto :eof +if "Visual Studio 2015"=="%APPVEYOR_BUILD_WORKER_IMAGE%" goto :eof + +mkdir build +cd build +cmake -G "Ninja" .. +ninja +cd.. diff --git a/CMakeLists.txt b/CMakeLists.txt index ac9d0e99..3de1b021 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ # LibTomCrypt, modular cryptographic library -- Tom St Denis # -cmake_minimum_required(VERSION 3.10) +cmake_minimum_required(VERSION 3.22) project( libtomcrypt diff --git a/appveyor.yml b/appveyor.yml index 4e95b4da..29cbf812 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -20,20 +20,13 @@ build_script: if "Visual Studio 2015"=="%APPVEYOR_BUILD_WORKER_IMAGE%" call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64 cd.. git clone https://github.com/libtom/libtommath.git --branch=master + cp libtomcrypt\.ci\cmake.bat libtommath\cmake.bat cd libtommath - mkdir build - cd build - cmake -G "Ninja" .. - ninja - cd.. + cmake.bat nmake -f makefile.msvc cd.. cd libtomcrypt - mkdir build - cd build - cmake -G "Ninja" .. - ninja - cd.. + .ci\cmake.bat nmake -f makefile.msvc all cp test.exe test-stock.exe cp timing.exe timing-stock.exe diff --git a/demos/CMakeLists.txt b/demos/CMakeLists.txt index a67db630..e577bffc 100644 --- a/demos/CMakeLists.txt +++ b/demos/CMakeLists.txt @@ -1,13 +1,6 @@ # ----------------------------------------------------------------------------- # Options # ----------------------------------------------------------------------------- -option(BUILD_USEFUL_DEMOS "Build useful demos (hashsum)" FALSE) -option( - BUILD_USABLE_DEMOS - "Build usable demos (aesgcm constants crypt openssh-privkey openssl-enc latex-tables sizes timing)" - FALSE -) -option(BUILD_TEST_DEMOS "Build test demos (small tv_gen)" FALSE) option(INSTALL_DEMOS "Install enabled demos (USEFUL and/or USABLE) and ltc wrapper script" FALSE) @@ -16,11 +9,13 @@ option(INSTALL_DEMOS "Install enabled demos (USEFUL and/or USABLE) and ltc wrapp # # Demos that are even somehow useful and could be installed as a system-tool # -# * USEFUL_DEMOS = hashsum # ----------------------------------------------------------------------------- +set(USEFUL_DEMOS hashsum) +list(JOIN USEFUL_DEMOS " " USEFUL_DEMOS_STR) +option(BUILD_USEFUL_DEMOS "Build useful demos (${USEFUL_DEMOS_STR})" FALSE) if(BUILD_USEFUL_DEMOS) - list(APPEND USABLE_DEMOS_TARGETS hashsum) + list(APPEND USABLE_DEMOS_TARGETS ${USEFUL_DEMOS}) endif() # ----------------------------------------------------------------------------- @@ -28,23 +23,13 @@ endif() # # Demos that are usable but only rarely make sense to be installed # -# USEABLE_DEMOS = aesgcm constants crypt der_print_flexi latex-tables openssh-privkey openssl-enc sizes timing # ----------------------------------------------------------------------------- +set(USABLE_DEMOS aesgcm constants crypt der_print_flexi latex-tables openssh-privkey openssl-enc sizes timing) +list(JOIN USABLE_DEMOS " " USABLE_DEMOS_STR) +option(BUILD_USABLE_DEMOS "Build usable demos (${USABLE_DEMOS_STR})" FALSE) if(BUILD_USABLE_DEMOS) - list( - APPEND - USABLE_DEMOS_TARGETS - aesgcm - constants - crypt - der_print_flexi - latex-tables - openssh-privkey - openssl-enc - sizes - timing - ) + list(APPEND USABLE_DEMOS_TARGETS ${USABLE_DEMOS}) endif() # ----------------------------------------------------------------------------- @@ -52,11 +37,13 @@ endif() # # Demos that are used for testing or measuring # -# * TEST_DEMOS = small tv_gen # ----------------------------------------------------------------------------- +set(TEST_DEMOS small tv_gen) +list(JOIN TEST_DEMOS " " TEST_DEMOS_STR) +option(BUILD_TEST_DEMOS "Build test demos (${TEST_DEMOS_STR})" FALSE) if(BUILD_TEST_DEMOS) - list(APPEND ALL_DEMOS_TARGETS small tv_gen) + list(APPEND ALL_DEMOS_TARGETS ${TEST_DEMOS}) endif() # -----------------------------------------------------------------------------