Skip to content

Commit

Permalink
wolfssh move THIS_USER to top
Browse files Browse the repository at this point in the history
  • Loading branch information
gojimmypi committed Dec 30, 2023
1 parent c831dac commit 3f5983d
Showing 1 changed file with 16 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,22 @@ set(COMPONENT_REQUIRES lwip wolfssl)
# We are typically in [root]/IDE/Espressif/ESP-IDF/examples/WOLFSSH_test/components/WOLFSSH
# The root of WOLFSSH is 7 directories up from here:

# find the user name to search for possible "WOLFSSH-username"
message(STATUS "USERNAME = $ENV{USERNAME}")
if( "$ENV{USER}" STREQUAL "" ) # the bash user
if( "$ENV{USERNAME}" STREQUAL "" ) # the Windows user
message(STATUS "could not find USER or USERNAME")
else()
# the bash user is not blank, so we'll use it.
set(THIS_USER "$ENV{USERNAME}")
endif()
else()
# the bash user is not blank, so we'll use it.
set(THIS_USER "$ENV{USER}")
endif()
message(STATUS "THIS_USER = ${THIS_USER}")


if(CMAKE_BUILD_EARLY_EXPANSION)
message(STATUS "WOLFSSH component CMAKE_BUILD_EARLY_EXPANSION:")
idf_component_register(
Expand Down Expand Up @@ -93,21 +109,6 @@ else()
get_filename_component(THIS_DIR "${CMAKE_CURRENT_SOURCE_DIR}" ABSOLUTE)
message(STATUS "THIS_DIR = ${THIS_DIR}")

# find the user name to search for possible "WOLFSSH-username"
message(STATUS "USERNAME = $ENV{USERNAME}")
if( "$ENV{USER}" STREQUAL "" ) # the bash user
if( "$ENV{USERNAME}" STREQUAL "" ) # the Windows user
message(STATUS "could not find USER or USERNAME")
else()
# the bash user is not blank, so we'll use it.
set(THIS_USER "$ENV{USERNAME}")
endif()
else()
# the bash user is not blank, so we'll use it.
set(THIS_USER "$ENV{USER}")
endif()
message(STATUS "THIS_USER = ${THIS_USER}")

# This same makefile is used for both the WOLFSSH component, and other
# components that may depend on WOLFSSH, such as wolfssh. Therefore
# we need to determine if this makefile is in the WOLFSSH repo, or
Expand Down

0 comments on commit 3f5983d

Please sign in to comment.