Closed jason-fan closed 5 years ago
你执行xmake -v 贴下详细的编译输出,我看下
xmake -v configure { arch = x86_64 ccache = true mode = release ndk_stdcxx = true plat = linux kind = static buildir = build clean = true host = linux }
=============== Build test release ================= checking for the gcc ... /usr/bin/gcc checking for the c++ compiler (cxx) ... gcc checking for the ccache ... /usr/bin/ccache checking for the /usr/bin/gcc ... ok checking for the flags (-O3) ... ok [ 0%]: ccache compiling.release fullpath.cpp /usr/bin/ccache /usr/bin/gcc -c -fvisibility=hidden -O3 -m64 -I/usr/local/include -I/usr/include -o build/.objs/test/linux/x86_64/release/./fullpath.cpp.o fullpath.cpp checking for the flags (-MMD -MF) ... ok checking for the g++ ... /usr/bin/g++ checking for the linker (ld) ... g++ [100%]: linking.release test /usr/bin/g++ -o build/linux/x86_64/release/test build/.objs/test/linux/x86_64/release/./fullpath.cpp.o -s -fvisibility=hidden -lpthread -ldl -lm -lreadline -m64 -L/usr/local/lib -L/usr/lib
ls -lt total 8 drwxrwxrwx 1 ubuntu ubuntu 4096 Jul 30 10:20 build drwxrwxrwx 1 ubuntu ubuntu 4096 Jul 30 10:20 d: drwxrwxrwx 1 ubuntu ubuntu 4096 Jul 30 10:20 'd:\cworks\testcpp.xmake' -rwxrwxrwx 1 ubuntu ubuntu 1364 Jul 30 10:19 fullpath.cpp -rwxrwxrwx 1 ubuntu ubuntu 1016 Jul 30 10:18 xmake.lua
tree . ├── build │ └── linux │ └── x86_64 │ └── release │ └── test ├── d: │ └── cworks │ └── testcpp ├── d:\cworks\testcpp.xmake ├── fullpath.cpp └── xmake.lua
确实有点怪,你敲下 ls -a testcpp
看下,有没有 .xmake目录,感觉像是 .xmake的配置目录生成到了 d:\cworks\testcpp.xmake
你再看下 你这是不是设置过 XMAKE_CONFIGDIR环境变量。
另外,我看到有 'D:\cworks\cpp.xmake\vscode-build.log' ,你这是vscode下调用执行xmake? 如果cmd下,直接手动执行命令 会有这个问题么? 我好确认下 是否是 xmake-vscode插件的问题
是在vscode的终端下执行的, settings.json "terminal.integrated.shell.windows": "c:\windows\system32\bash.exe", "terminal.external.windowsExec": "c:\windows\system32\bash.exe"
另外启动一个wsl(bash.exe),xmake -v能正常编译,不会产生这些奇怪路径,可能是你说的vscode插件的问题
那应该是xmake-vscode插件的问题。等回头我再看看。
我这边暂时没环境,你也可以clone下xmake-vscode源码,用vscode打开后,点击调试运行后,帮忙在你这本地环境直接调试下 xmake-vscode插件,看看是哪里的path处理有问题。。
我尝试性修复了下xmake-vscode插件,你更新下试试
更新后测试,没有问题了,谢谢!
在win10的子系统(wsl.exe)下,执行xmake出现dos风格的文件及路径 ls -l total 12 -rwxrwxrwx 1 ubuntu ubuntu 521 Jul 26 14:21 'D:\cworks\cpp.xmake\vscode-build.log' drwxrwxrwx 1 ubuntu ubuntu 4096 Jul 18 20:52 asio drwxrwxrwx 1 ubuntu ubuntu 4096 Jul 19 20:05 build drwxrwxrwx 1 ubuntu ubuntu 4096 Jul 26 10:21 'd:\cworks\cpp.xmake' drwxrwxrwx 1 ubuntu ubuntu 4096 Jul 15 09:36 lua53 drwxrwxrwx 1 ubuntu ubuntu 4096 Jul 24 09:49 modules drwxrwxrwx 1 ubuntu ubuntu 4096 Jul 22 20:17 ravi drwxrwxrwx 1 ubuntu ubuntu 4096 Jul 15 17:19 sol2 -rwxrwxrwx 1 ubuntu ubuntu 1522 Jul 26 14:15 xmake.lua
虽然可以编译通过,但有可能造成某些文件没有正确生成