Skip to content

Commit 6659f36

Browse files
levittesjaeckel
authored andcommitted
Align demo/CMakeLists.txt a bit more with with makefile_include.mk
Now, they build the same executables.
1 parent 1764254 commit 6659f36

2 files changed

Lines changed: 34 additions & 10 deletions

File tree

demos/CMakeLists.txt

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
#-----------------------------------------------------------------------------
44
option(BUILD_USEFUL_DEMOS "Build useful demos (hashsum)" FALSE)
55
option(BUILD_USABLE_DEMOS "Build usable demos (ltcrypt sizes constants pem-info)" FALSE)
6+
option(BUILD_TEST_DEMOS "Build test demos (small tv_gen)" FALSE)
67

78
#-----------------------------------------------------------------------------
89
# Useful demos
910
#-----------------------------------------------------------------------------
1011

1112
if(BUILD_USEFUL_DEMOS)
1213

13-
list(APPEND ALL_DEMOS_TARGETS hashsum tv_gen)
14+
list(APPEND ALL_DEMOS_TARGETS hashsum)
1415

1516
# hashsum
1617
add_executable(hashsum
@@ -21,15 +22,6 @@ if(BUILD_USEFUL_DEMOS)
2122
${PROJECT_NAME}
2223
)
2324

24-
# tv_gen
25-
add_executable(tv_gen
26-
${CMAKE_CURRENT_SOURCE_DIR}/tv_gen.c
27-
)
28-
29-
target_link_libraries(tv_gen PRIVATE
30-
${PROJECT_NAME}
31-
)
32-
3325
endif()
3426

3527
#-----------------------------------------------------------------------------
@@ -78,6 +70,34 @@ if(BUILD_USABLE_DEMOS)
7870

7971
endif()
8072

73+
#-----------------------------------------------------------------------------
74+
# Test demos
75+
#-----------------------------------------------------------------------------
76+
77+
if(BUILD_TEST_DEMOS)
78+
79+
list(APPEND ALL_DEMOS_TARGETS tv_gen)
80+
81+
# small
82+
add_executable(small
83+
${CMAKE_CURRENT_SOURCE_DIR}/small.c
84+
)
85+
86+
target_link_libraries(small PRIVATE
87+
${PROJECT_NAME}
88+
)
89+
90+
# tv_gen
91+
add_executable(tv_gen
92+
${CMAKE_CURRENT_SOURCE_DIR}/tv_gen.c
93+
)
94+
95+
target_link_libraries(tv_gen PRIVATE
96+
${PROJECT_NAME}
97+
)
98+
99+
endif()
100+
81101
#-----------------------------------------------------------------------------
82102
# Install targets
83103
#-----------------------------------------------------------------------------

demos/small.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55

66
int main(void)
77
{
8+
#ifdef LTC_RIJNDAEL
9+
#ifdef ENCRYPT_ONLY
810
register_cipher(&rijndael_enc_desc);
11+
#endif
12+
#endif
913
register_prng(&yarrow_desc);
1014
register_hash(&sha256_desc);
1115
return 0;

0 commit comments

Comments
 (0)