diff --git a/cmake/Yokai/Detection/detect b/cmake/Yokai/Detection/detect index f743697883..56966db068 100755 --- a/cmake/Yokai/Detection/detect +++ b/cmake/Yokai/Detection/detect @@ -56,7 +56,7 @@ do | sed -e 's/YOKAI_COMPILER/YOKAI_C_COMPILER/' \ | sed -e 's/YOKAI_SYSTEM/YOKAI_TARGET_SYSTEM/' \ | sed -e 's/YOKAI_ARCH/YOKAI_TARGET_ARCH/' \ - | sed -E 's/^([^=]+)=/\U\1=/' \ + | awk -F= '{print toupper($1) "=" $2}' \ || "${@}" "${file_path}" -o "${temp_file}" rm "${temp_file}" diff --git a/cmake/Yokai/System.cmake b/cmake/Yokai/System.cmake index bb873d4cc7..a8e9f329d1 100644 --- a/cmake/Yokai/System.cmake +++ b/cmake/Yokai/System.cmake @@ -40,16 +40,6 @@ function(yokai_detect_host_system) endif() endforeach() - if (system_name STREQUAL "Unknown") - message(WARNING "Host system detection failed, may misdetect the target as the host.") - - if (WIN32) - set(system_name "Windows") - elseif (APPLE) - set(system_name "macOS") - endif() - endif() - if (system_name STREQUAL "Unknown") set(SYSTEM_Darwin "macOS") set(SYSTEM_MSYS "Windows") @@ -59,8 +49,16 @@ function(yokai_detect_host_system) set(system_name "${SYSTEM_${name}}") endif() endforeach() + endif() - detect_cmake_host_system("system_name") + if (system_name STREQUAL "Unknown") + message(WARNING "Host system detection failed, may misdetect the target as the host.") + + if (WIN32) + set(system_name "Windows") + elseif (APPLE) + set(system_name "macOS") + endif() endif() set(YOKAI_HOST_SYSTEM_NAME "${system_name}" PARENT_SCOPE)