Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add xmake.cmd in bin folder for xmake #22537

Closed
6 tasks done
DeepChirp opened this issue Nov 14, 2024 · 3 comments
Closed
6 tasks done

Add xmake.cmd in bin folder for xmake #22537

DeepChirp opened this issue Nov 14, 2024 · 3 comments
Labels

Comments

@DeepChirp
Copy link

Description / Steps to reproduce the issue

I installed xmake and added the C:\msys64\clang64\bin directory to the environment variables. However, it seems that xmake cannot be called directly in the Windows environment unless the C:\msys64\clang64\share\xmake environment variable is added. But is it possible to add xmake.cmd to the bin directory similar to pnpm so that it can be called directly in Windows?

The following cmd script seems to work:

@echo off
set "BASEDIR=%~dp0"
if "%BASEDIR:~-1%"=="\" set "BASEDIR=%BASEDIR:~0,-1%"
if exist "%BASEDIR%\..\share\xmake\xmake.exe" (
    "%BASEDIR%\..\share\xmake\xmake.exe" %*
)

Expected behavior

Only add the C:\msys64\clang64\bin environment variable, and you can call xmake normally in the Windows environment.

Actual behavior

Only adding the C:\msys64\clang64\bin environment variable does not allow xmake to be called normally in the Windows environment.

Verification

Windows Version

MSYS_NT-10.0-26100

MINGW environments affected

  • MINGW64
  • MINGW32
  • UCRT64
  • CLANG64
  • CLANGARM64

Are you willing to submit a PR?

I would like to, but it is not clear how to modify the file

@DeepChirp DeepChirp added the bug label Nov 14, 2024
@waruqi
Copy link
Contributor

waruqi commented Nov 21, 2024

@DeepChirp
Copy link
Author

DeepChirp commented Nov 21, 2024

a shell wrapper should will be installed to c:/msys64/<env>/bin/xmake

https://github.com/xmake-io/xmake/blob/1bae1746ea64f19e0fe7e24ec2b0bbf22e78dee4/core/src/cli/xmake.sh#L72

https://github.com/xmake-io/xmake/blob/dev/scripts/msys/xmake.sh

Yes, but it is just a sh script. However, pnpm not only provides the sh script pnpm, but also provides pnpm.cmd and pnpm.ps1, which seems to be more convenient for integration with Windows. Just add c:/msys64/<env>/bin to the environment variable and you can call it directly in Windows. I think xmake may also be able to do this. Thanks!

@waruqi
Copy link
Contributor

waruqi commented Nov 21, 2024

a shell wrapper should will be installed to c:/msys64/<env>/bin/xmake
https://github.com/xmake-io/xmake/blob/1bae1746ea64f19e0fe7e24ec2b0bbf22e78dee4/core/src/cli/xmake.sh#L72
https://github.com/xmake-io/xmake/blob/dev/scripts/msys/xmake.sh

Yes, but it is just a sh script. However, pnpm not only provides the sh script pnpm, but also provides pnpm.cmd and pnpm.ps1, which seems to be more convenient for integration with Windows. Just add c:/msys64/<env>/bin to the environment variable and you can call it directly in Windows. I think xmake may also be able to do this. Thanks!

you can open a pr to add xmake.cmd and xmake.ps1 to xmake

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants