diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c34da9228..b0ece2a0ea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,7 +46,7 @@ option(ENABLE_PROGRAMS "Build mbed TLS programs." ON) option(UNSAFE_BUILD "Allow unsafe builds. These builds ARE NOT SECURE." OFF) option(MBEDTLS_FATAL_WARNINGS "Compiler warnings treated as errors" ON) -option(DEV_MODE "Development mode: (re)generate some files as needed" ON) +option(GEN_FILES "Generate the auto-generated files as needed" ON) string(REGEX MATCH "Clang" CMAKE_COMPILER_IS_CLANG "${CMAKE_C_COMPILER_ID}") string(REGEX MATCH "GNU" CMAKE_COMPILER_IS_GNU "${CMAKE_C_COMPILER_ID}") diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index f3b93fbdff..18aff5af39 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -109,7 +109,7 @@ set(src_tls ssl_tls13_generic.c ) -if(DEV_MODE) +if(GEN_FILES) find_package(Perl REQUIRED) file(GLOB error_headers ${CMAKE_CURRENT_SOURCE_DIR}/../include/mbedtls/*.h) diff --git a/programs/psa/CMakeLists.txt b/programs/psa/CMakeLists.txt index fd8eeea783..26ca73c185 100644 --- a/programs/psa/CMakeLists.txt +++ b/programs/psa/CMakeLists.txt @@ -4,7 +4,7 @@ set(executables psa_constant_names ) -if(DEV_MODE) +if(GEN_FILES) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/psa_constant_names_generated.c @@ -30,7 +30,7 @@ foreach(exe IN LISTS executables) endforeach() target_include_directories(psa_constant_names PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) -if(DEV_MODE) +if(GEN_FILES) add_custom_target(generate_psa_constant_names_generated_c DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/psa_constant_names_generated.c) add_dependencies(psa_constant_names generate_psa_constant_names_generated_c) diff --git a/programs/ssl/CMakeLists.txt b/programs/ssl/CMakeLists.txt index 066940e91b..280bbcf3d2 100644 --- a/programs/ssl/CMakeLists.txt +++ b/programs/ssl/CMakeLists.txt @@ -18,7 +18,7 @@ set(executables ssl_server2 ) -if(DEV_MODE) +if(GEN_FILES) # Inform CMake that the following file will be generated as part of the build # process, so it doesn't complain that it doesn't exist yet. Starting from # CMake 3.20, this will no longer be necessary as CMake will automatically @@ -42,7 +42,7 @@ foreach(exe IN LISTS executables) target_link_libraries(${exe} ${libs}) target_include_directories(${exe} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../tests/include) if(exe STREQUAL "ssl_client2" OR exe STREQUAL "ssl_server2") - if(DEV_MODE) + if(GEN_FILES) add_dependencies(${exe} generate_query_config_c) endif() target_include_directories(${exe} diff --git a/programs/test/CMakeLists.txt b/programs/test/CMakeLists.txt index 94331b8c7b..142a831667 100644 --- a/programs/test/CMakeLists.txt +++ b/programs/test/CMakeLists.txt @@ -27,7 +27,7 @@ if(TEST_CPP) target_link_libraries(cpp_dummy_build ${mbedcrypto_target}) endif() -if(DEV_MODE) +if(GEN_FILES) find_package(Perl REQUIRED) add_custom_command( diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 0bd94baa27..41dceed939 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -34,7 +34,7 @@ foreach(file ${base_generated_data_files}) list(APPEND generated_data_files ${CMAKE_CURRENT_BINARY_DIR}/${file}) endforeach() -if(DEV_MODE) +if(GEN_FILES) add_custom_command( OUTPUT ${generated_data_files} diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index f0e9a7d6c0..595b1baf91 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -1007,8 +1007,8 @@ component_test_ref_configs () { # the generated files only depend on the list of available options, not # whether they're on or off. So, disable cmake's (over-sensitive here) # dependency resolution for generated files and just rely on them being - # present (thanks to pre_generate_files) by turning DEV_MODE off. - CC=gcc cmake -D DEV_MODE=Off -D CMAKE_BUILD_TYPE:String=Asan . + # present (thanks to pre_generate_files) by turning GEN_FILES off. + CC=gcc cmake -D GEN_FILES=Off -D CMAKE_BUILD_TYPE:String=Asan . tests/scripts/test-ref-configs.pl }