Skip to content

Commit b267fab

Browse files
committed
Don't generate libwolfssl_output.h during CMAKE_BUILD_EARLY_EXPANSION
1 parent 8cd3743 commit b267fab

File tree

11 files changed

+99
-66
lines changed

11 files changed

+99
-66
lines changed

IDE/Espressif/ESP-IDF/examples/template/components/wolfssl/CMakeLists.txt

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,22 @@ set(THIS_ESP_TLS "")
4949
set(LIBWOLFSSL_CMAKE_OUTPUT "")
5050

5151

52-
# Initialize a new libwolfssl_output.h in the cmake build directory.
53-
if( EXISTS "${CMAKE_BINARY_DIR}/libwolfssl_output.h")
54-
# The next WRITE replaces a file.
55-
# This is here to remove any ambiguity on file removal & generation.
56-
file(REMOVE "${CMAKE_BINARY_DIR}/libwolfssl_output.h")
57-
endif()
52+
if(CMAKE_BUILD_EARLY_EXPANSION)
53+
message(STATUS "Skipping libwolfssl_output.h update during CMAKE_BUILD_EARLY_EXPANSION")
54+
else()
55+
# Initialize a new libwolfssl_output.h in the cmake build directory.
56+
if( EXISTS "${CMAKE_BINARY_DIR}/libwolfssl_output.h")
57+
# The next WRITE replaces a file.
58+
# This is here to remove any ambiguity on file removal & generation.
59+
file(REMOVE "${CMAKE_BINARY_DIR}/libwolfssl_output.h")
60+
endif()
5861

59-
file(WRITE "${CMAKE_BINARY_DIR}/libwolfssl_output.h"
60-
"/* libwolfssl_output.h generated by wolfssl component */\n"
61-
"#ifndef _LIBWOLFSSL_OUTPUT_H_\n"
62-
"\n"
63-
"#define _LIBWOLFSSL_OUTPUT_H_\n\n")
62+
file(WRITE "${CMAKE_BINARY_DIR}/libwolfssl_output.h"
63+
"/* libwolfssl_output.h generated by wolfssl component */\n"
64+
"#ifndef _LIBWOLFSSL_OUTPUT_H_\n"
65+
"\n"
66+
"#define _LIBWOLFSSL_OUTPUT_H_\n\n")
67+
endif()
6468

6569
# Append messages with:
6670
# LIBWOLFSSL_SAVE_INFO(LIBWOLFSSL_CMAKE_OUTPUT "${LIBWOLFSSL_CMAKE_OUTPUT}\n"message" "0")
@@ -119,6 +123,7 @@ function ( LIBWOLFSSL_SAVE_INFO VAR_OUTPUT THIS_VAR VAR_RESULT )
119123
if(LINE_COUNT GREATER 1)
120124
message(STATUS "Setting HAVE_LIBWOLFSSL_OUTPUT_HEADER=1 for ${VAR_OUTPUT}")
121125
add_compile_definitions(HAVE_LIBWOLFSSL_OUTPUT_HEADER=1)
126+
file(APPEND "${CMAKE_BINARY_DIR}/libwolfssl_output.h" "#undef ${VAR_OUTPUT}\n")
122127
file(APPEND "${CMAKE_BINARY_DIR}/libwolfssl_output.h" "#define ${VAR_OUTPUT} \\\n")
123128

124129
# Split into lines

IDE/Espressif/ESP-IDF/examples/template/components/wolfssl/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ menu "wolfSSL"
447447
help
448448
Enable debugging messages for wolfSSL. See user_settings.h for additional debug options.
449449

450-
config CONFIG_ESP_WOLFSSL_NO_STACK_SIZE_BUILD_WARNING
450+
config ESP_WOLFSSL_NO_STACK_SIZE_BUILD_WARNING
451451
bool "Suppress build-time warnings for main stack size"
452452
default n
453453
help

IDE/Espressif/ESP-IDF/examples/wolfssl_benchmark/components/wolfssl/CMakeLists.txt

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,22 @@ set(THIS_ESP_TLS "")
4949
set(LIBWOLFSSL_CMAKE_OUTPUT "")
5050

5151

52-
# Initialize a new libwolfssl_output.h in the cmake build directory.
53-
if( EXISTS "${CMAKE_BINARY_DIR}/libwolfssl_output.h")
54-
# The next WRITE replaces a file.
55-
# This is here to remove any ambiguity on file removal & generation.
56-
file(REMOVE "${CMAKE_BINARY_DIR}/libwolfssl_output.h")
57-
endif()
52+
if(CMAKE_BUILD_EARLY_EXPANSION)
53+
message(STATUS "Skipping libwolfssl_output.h update during CMAKE_BUILD_EARLY_EXPANSION")
54+
else()
55+
# Initialize a new libwolfssl_output.h in the cmake build directory.
56+
if( EXISTS "${CMAKE_BINARY_DIR}/libwolfssl_output.h")
57+
# The next WRITE replaces a file.
58+
# This is here to remove any ambiguity on file removal & generation.
59+
file(REMOVE "${CMAKE_BINARY_DIR}/libwolfssl_output.h")
60+
endif()
5861

59-
file(WRITE "${CMAKE_BINARY_DIR}/libwolfssl_output.h"
60-
"/* libwolfssl_output.h generated by wolfssl component */\n"
61-
"#ifndef _LIBWOLFSSL_OUTPUT_H_\n"
62-
"\n"
63-
"#define _LIBWOLFSSL_OUTPUT_H_\n\n")
62+
file(WRITE "${CMAKE_BINARY_DIR}/libwolfssl_output.h"
63+
"/* libwolfssl_output.h generated by wolfssl component */\n"
64+
"#ifndef _LIBWOLFSSL_OUTPUT_H_\n"
65+
"\n"
66+
"#define _LIBWOLFSSL_OUTPUT_H_\n\n")
67+
endif()
6468

6569
# Append messages with:
6670
# LIBWOLFSSL_SAVE_INFO(LIBWOLFSSL_CMAKE_OUTPUT "${LIBWOLFSSL_CMAKE_OUTPUT}\n"message" "0")
@@ -119,6 +123,7 @@ function ( LIBWOLFSSL_SAVE_INFO VAR_OUTPUT THIS_VAR VAR_RESULT )
119123
if(LINE_COUNT GREATER 1)
120124
message(STATUS "Setting HAVE_LIBWOLFSSL_OUTPUT_HEADER=1 for ${VAR_OUTPUT}")
121125
add_compile_definitions(HAVE_LIBWOLFSSL_OUTPUT_HEADER=1)
126+
file(APPEND "${CMAKE_BINARY_DIR}/libwolfssl_output.h" "#undef ${VAR_OUTPUT}\n")
122127
file(APPEND "${CMAKE_BINARY_DIR}/libwolfssl_output.h" "#define ${VAR_OUTPUT} \\\n")
123128

124129
# Split into lines

IDE/Espressif/ESP-IDF/examples/wolfssl_benchmark/components/wolfssl/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ menu "wolfSSL"
447447
help
448448
Enable debugging messages for wolfSSL. See user_settings.h for additional debug options.
449449

450-
config CONFIG_ESP_WOLFSSL_NO_STACK_SIZE_BUILD_WARNING
450+
config ESP_WOLFSSL_NO_STACK_SIZE_BUILD_WARNING
451451
bool "Suppress build-time warnings for main stack size"
452452
default n
453453
help

IDE/Espressif/ESP-IDF/examples/wolfssl_client/components/wolfssl/CMakeLists.txt

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,22 @@ set(THIS_ESP_TLS "")
4949
set(LIBWOLFSSL_CMAKE_OUTPUT "")
5050

5151

52-
# Initialize a new libwolfssl_output.h in the cmake build directory.
53-
if( EXISTS "${CMAKE_BINARY_DIR}/libwolfssl_output.h")
54-
# The next WRITE replaces a file.
55-
# This is here to remove any ambiguity on file removal & generation.
56-
file(REMOVE "${CMAKE_BINARY_DIR}/libwolfssl_output.h")
57-
endif()
52+
if(CMAKE_BUILD_EARLY_EXPANSION)
53+
message(STATUS "Skipping libwolfssl_output.h update during CMAKE_BUILD_EARLY_EXPANSION")
54+
else()
55+
# Initialize a new libwolfssl_output.h in the cmake build directory.
56+
if( EXISTS "${CMAKE_BINARY_DIR}/libwolfssl_output.h")
57+
# The next WRITE replaces a file.
58+
# This is here to remove any ambiguity on file removal & generation.
59+
file(REMOVE "${CMAKE_BINARY_DIR}/libwolfssl_output.h")
60+
endif()
5861

59-
file(WRITE "${CMAKE_BINARY_DIR}/libwolfssl_output.h"
60-
"/* libwolfssl_output.h generated by wolfssl component */\n"
61-
"#ifndef _LIBWOLFSSL_OUTPUT_H_\n"
62-
"\n"
63-
"#define _LIBWOLFSSL_OUTPUT_H_\n\n")
62+
file(WRITE "${CMAKE_BINARY_DIR}/libwolfssl_output.h"
63+
"/* libwolfssl_output.h generated by wolfssl component */\n"
64+
"#ifndef _LIBWOLFSSL_OUTPUT_H_\n"
65+
"\n"
66+
"#define _LIBWOLFSSL_OUTPUT_H_\n\n")
67+
endif()
6468

6569
# Append messages with:
6670
# LIBWOLFSSL_SAVE_INFO(LIBWOLFSSL_CMAKE_OUTPUT "${LIBWOLFSSL_CMAKE_OUTPUT}\n"message" "0")
@@ -119,6 +123,7 @@ function ( LIBWOLFSSL_SAVE_INFO VAR_OUTPUT THIS_VAR VAR_RESULT )
119123
if(LINE_COUNT GREATER 1)
120124
message(STATUS "Setting HAVE_LIBWOLFSSL_OUTPUT_HEADER=1 for ${VAR_OUTPUT}")
121125
add_compile_definitions(HAVE_LIBWOLFSSL_OUTPUT_HEADER=1)
126+
file(APPEND "${CMAKE_BINARY_DIR}/libwolfssl_output.h" "#undef ${VAR_OUTPUT}\n")
122127
file(APPEND "${CMAKE_BINARY_DIR}/libwolfssl_output.h" "#define ${VAR_OUTPUT} \\\n")
123128

124129
# Split into lines

IDE/Espressif/ESP-IDF/examples/wolfssl_client/components/wolfssl/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ menu "wolfSSL"
447447
help
448448
Enable debugging messages for wolfSSL. See user_settings.h for additional debug options.
449449

450-
config CONFIG_ESP_WOLFSSL_NO_STACK_SIZE_BUILD_WARNING
450+
config ESP_WOLFSSL_NO_STACK_SIZE_BUILD_WARNING
451451
bool "Suppress build-time warnings for main stack size"
452452
default n
453453
help

IDE/Espressif/ESP-IDF/examples/wolfssl_server/components/wolfssl/CMakeLists.txt

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,22 @@ set(THIS_ESP_TLS "")
4949
set(LIBWOLFSSL_CMAKE_OUTPUT "")
5050

5151

52-
# Initialize a new libwolfssl_output.h in the cmake build directory.
53-
if( EXISTS "${CMAKE_BINARY_DIR}/libwolfssl_output.h")
54-
# The next WRITE replaces a file.
55-
# This is here to remove any ambiguity on file removal & generation.
56-
file(REMOVE "${CMAKE_BINARY_DIR}/libwolfssl_output.h")
57-
endif()
52+
if(CMAKE_BUILD_EARLY_EXPANSION)
53+
message(STATUS "Skipping libwolfssl_output.h update during CMAKE_BUILD_EARLY_EXPANSION")
54+
else()
55+
# Initialize a new libwolfssl_output.h in the cmake build directory.
56+
if( EXISTS "${CMAKE_BINARY_DIR}/libwolfssl_output.h")
57+
# The next WRITE replaces a file.
58+
# This is here to remove any ambiguity on file removal & generation.
59+
file(REMOVE "${CMAKE_BINARY_DIR}/libwolfssl_output.h")
60+
endif()
5861

59-
file(WRITE "${CMAKE_BINARY_DIR}/libwolfssl_output.h"
60-
"/* libwolfssl_output.h generated by wolfssl component */\n"
61-
"#ifndef _LIBWOLFSSL_OUTPUT_H_\n"
62-
"\n"
63-
"#define _LIBWOLFSSL_OUTPUT_H_\n\n")
62+
file(WRITE "${CMAKE_BINARY_DIR}/libwolfssl_output.h"
63+
"/* libwolfssl_output.h generated by wolfssl component */\n"
64+
"#ifndef _LIBWOLFSSL_OUTPUT_H_\n"
65+
"\n"
66+
"#define _LIBWOLFSSL_OUTPUT_H_\n\n")
67+
endif()
6468

6569
# Append messages with:
6670
# LIBWOLFSSL_SAVE_INFO(LIBWOLFSSL_CMAKE_OUTPUT "${LIBWOLFSSL_CMAKE_OUTPUT}\n"message" "0")
@@ -119,6 +123,7 @@ function ( LIBWOLFSSL_SAVE_INFO VAR_OUTPUT THIS_VAR VAR_RESULT )
119123
if(LINE_COUNT GREATER 1)
120124
message(STATUS "Setting HAVE_LIBWOLFSSL_OUTPUT_HEADER=1 for ${VAR_OUTPUT}")
121125
add_compile_definitions(HAVE_LIBWOLFSSL_OUTPUT_HEADER=1)
126+
file(APPEND "${CMAKE_BINARY_DIR}/libwolfssl_output.h" "#undef ${VAR_OUTPUT}\n")
122127
file(APPEND "${CMAKE_BINARY_DIR}/libwolfssl_output.h" "#define ${VAR_OUTPUT} \\\n")
123128

124129
# Split into lines

IDE/Espressif/ESP-IDF/examples/wolfssl_server/components/wolfssl/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ menu "wolfSSL"
447447
help
448448
Enable debugging messages for wolfSSL. See user_settings.h for additional debug options.
449449

450-
config CONFIG_ESP_WOLFSSL_NO_STACK_SIZE_BUILD_WARNING
450+
config ESP_WOLFSSL_NO_STACK_SIZE_BUILD_WARNING
451451
bool "Suppress build-time warnings for main stack size"
452452
default n
453453
help

IDE/Espressif/ESP-IDF/examples/wolfssl_test/components/wolfssl/CMakeLists.txt

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,22 @@ set(THIS_ESP_TLS "")
4949
set(LIBWOLFSSL_CMAKE_OUTPUT "")
5050

5151

52-
# Initialize a new libwolfssl_output.h in the cmake build directory.
53-
if( EXISTS "${CMAKE_BINARY_DIR}/libwolfssl_output.h")
54-
# The next WRITE replaces a file.
55-
# This is here to remove any ambiguity on file removal & generation.
56-
file(REMOVE "${CMAKE_BINARY_DIR}/libwolfssl_output.h")
57-
endif()
52+
if(CMAKE_BUILD_EARLY_EXPANSION)
53+
message(STATUS "Skipping libwolfssl_output.h update during CMAKE_BUILD_EARLY_EXPANSION")
54+
else()
55+
# Initialize a new libwolfssl_output.h in the cmake build directory.
56+
if( EXISTS "${CMAKE_BINARY_DIR}/libwolfssl_output.h")
57+
# The next WRITE replaces a file.
58+
# This is here to remove any ambiguity on file removal & generation.
59+
file(REMOVE "${CMAKE_BINARY_DIR}/libwolfssl_output.h")
60+
endif()
5861

59-
file(WRITE "${CMAKE_BINARY_DIR}/libwolfssl_output.h"
60-
"/* libwolfssl_output.h generated by wolfssl component */\n"
61-
"#ifndef _LIBWOLFSSL_OUTPUT_H_\n"
62-
"\n"
63-
"#define _LIBWOLFSSL_OUTPUT_H_\n\n")
62+
file(WRITE "${CMAKE_BINARY_DIR}/libwolfssl_output.h"
63+
"/* libwolfssl_output.h generated by wolfssl component */\n"
64+
"#ifndef _LIBWOLFSSL_OUTPUT_H_\n"
65+
"\n"
66+
"#define _LIBWOLFSSL_OUTPUT_H_\n\n")
67+
endif()
6468

6569
# Append messages with:
6670
# LIBWOLFSSL_SAVE_INFO(LIBWOLFSSL_CMAKE_OUTPUT "${LIBWOLFSSL_CMAKE_OUTPUT}\n"message" "0")
@@ -119,6 +123,7 @@ function ( LIBWOLFSSL_SAVE_INFO VAR_OUTPUT THIS_VAR VAR_RESULT )
119123
if(LINE_COUNT GREATER 1)
120124
message(STATUS "Setting HAVE_LIBWOLFSSL_OUTPUT_HEADER=1 for ${VAR_OUTPUT}")
121125
add_compile_definitions(HAVE_LIBWOLFSSL_OUTPUT_HEADER=1)
126+
file(APPEND "${CMAKE_BINARY_DIR}/libwolfssl_output.h" "#undef ${VAR_OUTPUT}\n")
122127
file(APPEND "${CMAKE_BINARY_DIR}/libwolfssl_output.h" "#define ${VAR_OUTPUT} \\\n")
123128

124129
# Split into lines

IDE/Espressif/ESP-IDF/examples/wolfssl_test/components/wolfssl/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ menu "wolfSSL"
447447
help
448448
Enable debugging messages for wolfSSL. See user_settings.h for additional debug options.
449449

450-
config CONFIG_ESP_WOLFSSL_NO_STACK_SIZE_BUILD_WARNING
450+
config ESP_WOLFSSL_NO_STACK_SIZE_BUILD_WARNING
451451
bool "Suppress build-time warnings for main stack size"
452452
default n
453453
help

0 commit comments

Comments
 (0)