Skip to content

Commit 91757cf

Browse files
committed
Bump required CMake version & DRY
* The oldest supported Ubuntu Version is 22.04 which comes with CMake 3.22. * Refactor demos/CMakeLists.txt to set the list of binaries only once. Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
1 parent d8a62f3 commit 91757cf

File tree

4 files changed

+25
-36
lines changed

4 files changed

+25
-36
lines changed

.ci/cmake.bat

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
if "Visual Studio 2017"=="%APPVEYOR_BUILD_WORKER_IMAGE%" goto :eof
3+
if "Visual Studio 2015"=="%APPVEYOR_BUILD_WORKER_IMAGE%" goto :eof
4+
5+
mkdir build
6+
cd build
7+
cmake -G "Ninja" ..
8+
ninja
9+
cd..

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# LibTomCrypt, modular cryptographic library -- Tom St Denis
44
#
55

6-
cmake_minimum_required(VERSION 3.10)
6+
cmake_minimum_required(VERSION 3.22)
77

88
project(
99
libtomcrypt

appveyor.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,13 @@ build_script:
2020
if "Visual Studio 2015"=="%APPVEYOR_BUILD_WORKER_IMAGE%" call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64
2121
cd..
2222
git clone https://github.com/libtom/libtommath.git --branch=master
23+
cp libtomcrypt\.ci\cmake.bat libtommath\cmake.bat
2324
cd libtommath
24-
mkdir build
25-
cd build
26-
cmake -G "Ninja" ..
27-
ninja
28-
cd..
25+
cmake.bat
2926
nmake -f makefile.msvc
3027
cd..
3128
cd libtomcrypt
32-
mkdir build
33-
cd build
34-
cmake -G "Ninja" ..
35-
ninja
36-
cd..
29+
.ci\cmake.bat
3730
nmake -f makefile.msvc all
3831
cp test.exe test-stock.exe
3932
cp timing.exe timing-stock.exe

demos/CMakeLists.txt

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
# -----------------------------------------------------------------------------
22
# Options
33
# -----------------------------------------------------------------------------
4-
option(BUILD_USEFUL_DEMOS "Build useful demos (hashsum)" FALSE)
5-
option(
6-
BUILD_USABLE_DEMOS
7-
"Build usable demos (aesgcm constants crypt openssh-privkey openssl-enc latex-tables sizes timing)"
8-
FALSE
9-
)
10-
option(BUILD_TEST_DEMOS "Build test demos (small tv_gen)" FALSE)
114

125
option(INSTALL_DEMOS "Install enabled demos (USEFUL and/or USABLE) and ltc wrapper script" FALSE)
136

@@ -16,47 +9,41 @@ option(INSTALL_DEMOS "Install enabled demos (USEFUL and/or USABLE) and ltc wrapp
169
#
1710
# Demos that are even somehow useful and could be installed as a system-tool
1811
#
19-
# * USEFUL_DEMOS = hashsum
2012
# -----------------------------------------------------------------------------
13+
set(USEFUL_DEMOS hashsum)
14+
list(JOIN USEFUL_DEMOS " " USEFUL_DEMOS_STR)
15+
option(BUILD_USEFUL_DEMOS "Build useful demos (${USEFUL_DEMOS_STR})" FALSE)
2116

2217
if(BUILD_USEFUL_DEMOS)
23-
list(APPEND USABLE_DEMOS_TARGETS hashsum)
18+
list(APPEND USABLE_DEMOS_TARGETS ${USEFUL_DEMOS})
2419
endif()
2520

2621
# -----------------------------------------------------------------------------
2722
# Usable demos
2823
#
2924
# Demos that are usable but only rarely make sense to be installed
3025
#
31-
# USEABLE_DEMOS = aesgcm constants crypt der_print_flexi latex-tables openssh-privkey openssl-enc sizes timing
3226
# -----------------------------------------------------------------------------
27+
set(USABLE_DEMOS aesgcm constants crypt der_print_flexi latex-tables openssh-privkey openssl-enc sizes timing)
28+
list(JOIN USABLE_DEMOS " " USABLE_DEMOS_STR)
29+
option(BUILD_USABLE_DEMOS "Build usable demos (${USABLE_DEMOS_STR})" FALSE)
3330

3431
if(BUILD_USABLE_DEMOS)
35-
list(
36-
APPEND
37-
USABLE_DEMOS_TARGETS
38-
aesgcm
39-
constants
40-
crypt
41-
der_print_flexi
42-
latex-tables
43-
openssh-privkey
44-
openssl-enc
45-
sizes
46-
timing
47-
)
32+
list(APPEND USABLE_DEMOS_TARGETS ${USABLE_DEMOS})
4833
endif()
4934

5035
# -----------------------------------------------------------------------------
5136
# Test demos
5237
#
5338
# Demos that are used for testing or measuring
5439
#
55-
# * TEST_DEMOS = small tv_gen
5640
# -----------------------------------------------------------------------------
41+
set(TEST_DEMOS small tv_gen)
42+
list(JOIN TEST_DEMOS " " TEST_DEMOS_STR)
43+
option(BUILD_TEST_DEMOS "Build test demos (${TEST_DEMOS_STR})" FALSE)
5744

5845
if(BUILD_TEST_DEMOS)
59-
list(APPEND ALL_DEMOS_TARGETS small tv_gen)
46+
list(APPEND ALL_DEMOS_TARGETS ${TEST_DEMOS})
6047
endif()
6148

6249
# -----------------------------------------------------------------------------

0 commit comments

Comments
 (0)