File tree Expand file tree Collapse file tree 2 files changed +29
-17
lines changed Expand file tree Collapse file tree 2 files changed +29
-17
lines changed Original file line number Diff line number Diff line change @@ -22,10 +22,37 @@ include(FetchContent)
22
22
23
23
FetchContent_Declare (
24
24
mbedtls
25
- PATCH_COMMAND git apply "${CMAKE_CURRENT_LIST_DIR} /mbedtls.patch"
26
25
GIT_REPOSITORY http://github.com/mbed-TLS/mbedtls.git
27
26
GIT_TAG v3.6.3.1
28
27
GIT_SHALLOW 1
29
28
)
30
29
31
- FetchContent_MakeAvailable (mbedtls )
30
+ include (CheckCompilerFlag )
31
+ check_compiler_flag (C -Wno-unterminated-string-initialization compiler_supports_unterminated_string_initialization )
32
+
33
+ if (${compiler_supports_unterminated_string_initialization} )
34
+ get_property (
35
+ compile_options
36
+ DIRECTORY
37
+ PROPERTY COMPILE_OPTIONS
38
+ )
39
+
40
+ set_property (
41
+ DIRECTORY
42
+ APPEND
43
+ PROPERTY COMPILE_OPTIONS -Wno-unterminated-string-initialization
44
+ )
45
+
46
+ FetchContent_MakeAvailable (mbedtls )
47
+
48
+ set_property (
49
+ DIRECTORY
50
+ PROPERTY COMPILE_OPTIONS ${compile_options}
51
+ )
52
+
53
+ unset (compile_options )
54
+ else ()
55
+ FetchContent_MakeAvailable (mbedtls )
56
+ endif ()
57
+
58
+ unset (compiler_supports_unterminated_string_initialization )
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments