Merge pull request #6322 from lealem47/remove_shellscript
Fix for CMake with USER_SETTINGS on Windows
This commit is contained in:
commit
3e5c8af571
@ -1660,6 +1660,10 @@ add_option("WOLFSSL_USER_SETTINGS"
|
||||
"Use your own user_settings.h and do not add Makefile CFLAGS (default: disabled)"
|
||||
"no" "yes;no")
|
||||
|
||||
add_option("WOLFSSL_USER_SETTINGS_ASM"
|
||||
"Enable use of user_settings_asm.h in assembly files (default: disabled)"
|
||||
"no" "yes;no")
|
||||
|
||||
add_option("WOLFSSL_OPTFLAGS"
|
||||
"Enable default optimization CFLAGS for the compiler (default: enabled)"
|
||||
"yes" "yes;no")
|
||||
@ -1822,14 +1826,30 @@ generate_build_flags()
|
||||
if(WOLFSSL_USER_SETTINGS)
|
||||
# Replace all options and just use WOLFSSL_USER_SETTINGS
|
||||
set(WOLFSSL_DEFINITIONS "-DWOLFSSL_USER_SETTINGS")
|
||||
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_USER_SETTINGS_ASM")
|
||||
endif()
|
||||
|
||||
# Create user_settings_asm.h for use in assembly files (e.g. .S files).
|
||||
execute_process(COMMAND $ENV{SHELL} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/user_settings_asm.sh
|
||||
"${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS}"
|
||||
RESULT_VARIABLE USER_SETTINGS_ASM_RET)
|
||||
if (NOT USER_SETTINGS_ASM_RET EQUAL 0)
|
||||
message(FATAL_ERROR "${CMAKE_CURRENT_SOURCE_DIR}/scripts/user_settings_asm.sh failed.")
|
||||
if(WOLFSSL_USER_SETTINGS_ASM)
|
||||
if(WOLFSSL_USER_SETTINGS)
|
||||
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_USER_SETTINGS_ASM")
|
||||
# Create user_settings_asm.h for use in assembly files (e.g. .S files).
|
||||
if(WIN32)
|
||||
execute_process(COMMAND
|
||||
$ENV{SHELL} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/user_settings_asm.sh
|
||||
"${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS}"
|
||||
RESULT_VARIABLE USER_SETTINGS_ASM_RET)
|
||||
else()
|
||||
execute_process(COMMAND
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/scripts/user_settings_asm.sh
|
||||
"${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS}"
|
||||
RESULT_VARIABLE USER_SETTINGS_ASM_RET)
|
||||
endif()
|
||||
if (NOT USER_SETTINGS_ASM_RET EQUAL 0)
|
||||
message(FATAL_ERROR
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/scripts/user_settings_asm.sh failed.")
|
||||
endif()
|
||||
else()
|
||||
message(FATAL_ERROR
|
||||
"Must have WOLFSSL_USER_SETTINGS to enable WOLFSSL_USER_SETTINGS_ASM.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user