fix: add Windows build support for morselib#7
Open
iot-with-vsr wants to merge 1 commit intoMorseMicro:mainfrom
Open
fix: add Windows build support for morselib#7iot-with-vsr wants to merge 1 commit intoMorseMicro:mainfrom
iot-with-vsr wants to merge 1 commit intoMorseMicro:mainfrom
Conversation
On Windows, the morselib build fails due to three platform-specific issues:
1. CMAKE_OBJCOPY ends with .exe, so the regex to extract the toolchain
base path fails to match, producing invalid tool paths like
objcopy.exear instead of ar.
2. Shell pipes in CMake COMMAND don't work when Ninja wraps commands in
cmd.exe /C. Replace with a CMake script using execute_process with
INPUT_FILE to feed stdin to ar -M.
3. .py scripts are not directly executable via cmd.exe. Invoke the
librarymangler via ${PYTHON} explicitly.
All fixes are gated behind if(CMAKE_HOST_WIN32) so Linux/macOS builds
are unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes three issues that prevent the
ap_modeexample (and any example usingCONFIG_BUILD_SUPPLICANT_FROM_SOURCE=y) from building on Windows with ESP-IDF v5.2.6.CMAKE_OBJCOPYends with.exeon Windows, so the regexobjcopy$fails to extract the toolchain base, producing invalid paths likeobjcopy.exearinstead ofarcmake -E cat | ar -Mpipe doesn't work when Ninja wraps commands incmd.exe /C. Replaced with a CMake-Pscript usingexecute_process(... INPUT_FILE ...)to feed stdin toar -M.pyfiles are not directly executable as commands viacmd.exe. Invokelibrarymangler.pyvia${PYTHON}explicitlyAll fixes are gated behind
if(CMAKE_HOST_WIN32)so Linux/macOS builds are completely unchanged.Test plan
ap_modeexample builds successfully on Windows (ESP-IDF v5.2.6, ESP32-S3)porting_assistant,scan,sta_connect) continue to buildelse()branches)