mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-01 10:06:53 +03:00
Rename DEV_MODE to GEN_FILES
GEN_FILES is a bit clearer as it describes what the setting does more precisely. Signed-off-by: David Horstmann <david.horstmann@arm.com>
This commit is contained in:
@ -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(UNSAFE_BUILD "Allow unsafe builds. These builds ARE NOT SECURE." OFF)
|
||||||
option(MBEDTLS_FATAL_WARNINGS "Compiler warnings treated as errors" ON)
|
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 "Clang" CMAKE_COMPILER_IS_CLANG "${CMAKE_C_COMPILER_ID}")
|
||||||
string(REGEX MATCH "GNU" CMAKE_COMPILER_IS_GNU "${CMAKE_C_COMPILER_ID}")
|
string(REGEX MATCH "GNU" CMAKE_COMPILER_IS_GNU "${CMAKE_C_COMPILER_ID}")
|
||||||
|
@ -109,7 +109,7 @@ set(src_tls
|
|||||||
ssl_tls13_generic.c
|
ssl_tls13_generic.c
|
||||||
)
|
)
|
||||||
|
|
||||||
if(DEV_MODE)
|
if(GEN_FILES)
|
||||||
find_package(Perl REQUIRED)
|
find_package(Perl REQUIRED)
|
||||||
|
|
||||||
file(GLOB error_headers ${CMAKE_CURRENT_SOURCE_DIR}/../include/mbedtls/*.h)
|
file(GLOB error_headers ${CMAKE_CURRENT_SOURCE_DIR}/../include/mbedtls/*.h)
|
||||||
|
@ -4,7 +4,7 @@ set(executables
|
|||||||
psa_constant_names
|
psa_constant_names
|
||||||
)
|
)
|
||||||
|
|
||||||
if(DEV_MODE)
|
if(GEN_FILES)
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT
|
OUTPUT
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/psa_constant_names_generated.c
|
${CMAKE_CURRENT_BINARY_DIR}/psa_constant_names_generated.c
|
||||||
@ -30,7 +30,7 @@ foreach(exe IN LISTS executables)
|
|||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
target_include_directories(psa_constant_names PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
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
|
add_custom_target(generate_psa_constant_names_generated_c
|
||||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/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)
|
add_dependencies(psa_constant_names generate_psa_constant_names_generated_c)
|
||||||
|
@ -18,7 +18,7 @@ set(executables
|
|||||||
ssl_server2
|
ssl_server2
|
||||||
)
|
)
|
||||||
|
|
||||||
if(DEV_MODE)
|
if(GEN_FILES)
|
||||||
# Inform CMake that the following file will be generated as part of the build
|
# 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
|
# 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
|
# 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_link_libraries(${exe} ${libs})
|
||||||
target_include_directories(${exe} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../tests/include)
|
target_include_directories(${exe} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../tests/include)
|
||||||
if(exe STREQUAL "ssl_client2" OR exe STREQUAL "ssl_server2")
|
if(exe STREQUAL "ssl_client2" OR exe STREQUAL "ssl_server2")
|
||||||
if(DEV_MODE)
|
if(GEN_FILES)
|
||||||
add_dependencies(${exe} generate_query_config_c)
|
add_dependencies(${exe} generate_query_config_c)
|
||||||
endif()
|
endif()
|
||||||
target_include_directories(${exe}
|
target_include_directories(${exe}
|
||||||
|
@ -27,7 +27,7 @@ if(TEST_CPP)
|
|||||||
target_link_libraries(cpp_dummy_build ${mbedcrypto_target})
|
target_link_libraries(cpp_dummy_build ${mbedcrypto_target})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(DEV_MODE)
|
if(GEN_FILES)
|
||||||
find_package(Perl REQUIRED)
|
find_package(Perl REQUIRED)
|
||||||
|
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
|
@ -34,7 +34,7 @@ foreach(file ${base_generated_data_files})
|
|||||||
list(APPEND generated_data_files ${CMAKE_CURRENT_BINARY_DIR}/${file})
|
list(APPEND generated_data_files ${CMAKE_CURRENT_BINARY_DIR}/${file})
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
if(DEV_MODE)
|
if(GEN_FILES)
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT
|
OUTPUT
|
||||||
${generated_data_files}
|
${generated_data_files}
|
||||||
|
@ -1007,8 +1007,8 @@ component_test_ref_configs () {
|
|||||||
# the generated files only depend on the list of available options, not
|
# 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)
|
# whether they're on or off. So, disable cmake's (over-sensitive here)
|
||||||
# dependency resolution for generated files and just rely on them being
|
# dependency resolution for generated files and just rely on them being
|
||||||
# present (thanks to pre_generate_files) by turning DEV_MODE off.
|
# present (thanks to pre_generate_files) by turning GEN_FILES off.
|
||||||
CC=gcc cmake -D DEV_MODE=Off -D CMAKE_BUILD_TYPE:String=Asan .
|
CC=gcc cmake -D GEN_FILES=Off -D CMAKE_BUILD_TYPE:String=Asan .
|
||||||
tests/scripts/test-ref-configs.pl
|
tests/scripts/test-ref-configs.pl
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user