-
-
Notifications
You must be signed in to change notification settings - Fork 819
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
Improve toolchain to support host and cross toolchains at same time #857
Conversation
example target("test")
set_kind("binary")
set_plat(os.host()) --> 当交叉编译的时候,强制对test目标切到host工具链编译
set_arch(os.arch())
add_files("src/*.c") 或者 target("test")
set_kind("binary")
set_toolchains("xcode", {plat = os.host(), arch = os.arch()})
add_files("src/*.c") |
@orzuk-lmj 方便抽空帮忙测试下这个toolchain分支么,我最近对msvc工具链改动比较大,虽然ci上测试ok,还是想多测下,你这环境应该比复杂点,如果能通过,那基本问题应该不大了。 xmake update github:xmake-io/xmake#toolchain |
我用win10 git checkout最新 toolchain 分支的時候有遇到錯誤訊息
感覺是在試驗路徑最大長度,但這樣的話在win10就抓不下來了 |
哦 这个我刚去掉了,你拉最新的commit试试 |
遇到個問題,錯誤訊息如下: [ 37%]: compiling.debug src\mztools.c
cl.exe -c -FS -Zi -Fd..\_build\vs2015-x64-debug\windows\x64\debug\compile.minizip.pdb -W3 -WX -Od -Iinc -D__platform_windows__ -D__config_x64__ -D__config_debug__ -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DDEBUG -D_DEBUG -D_CRT_SECURE_NO_WARNINGS /GR /EHsc /MP /openmp /bigobj /MDd /Ob0 /RTC1 -nologo -Fo..\_build\vs2015-x64-debug\.objs\minizip\windows\x64\debug\src\mztools.c.obj src\mztools.c
error: @programdir\modules\private\async\runjobs.lua:207: @programdir\modules\private\action\build\object.lua:75: @programdir\modules\core\tools\cl.lua:383:
stack traceback:
[C]: in function 'error'
[@programdir\core\base\os.lua:792]: in function 'raise'
[@programdir\modules\core\tools\cl.lua:383]: in function 'catch'
[@programdir\core\sandbox\modules\try.lua:127]: in function 'try'
[@programdir\modules\core\tools\cl.lua:346]:
[C]: in function 'compile'
[@programdir\modules\private\action\build\object.lua:75]: in function 'script'
[@programdir\modules\private\action\build\object.lua:88]: in function '_build_object'
[@programdir\modules\private\action\build\object.lua:113]: in function 'jobfunc'
[@programdir\modules\private\async\runjobs.lua:185]:
[C]: in function 'trycall'
[@programdir\core\sandbox\modules\try.lua:121]: in function 'try'
[@programdir\modules\private\async\runjobs.lua:182]: in function 'cotask'
[@programdir\core\base\scheduler.lua:317]:
stack traceback:
[C]: in function 'error'
@programdir\core\base\os.lua:792: in function 'raise'
@programdir\modules\private\async\runjobs.lua:207: in function 'catch'
@programdir\core\sandbox\modules\try.lua:127: in function 'try'
@programdir\modules\private\async\runjobs.lua:182: in function 'cotask'
@programdir\core\base\scheduler.lua:317: in function <@programdir\core\base\scheduler.lua:315> |
你这里怎么还是老的?确定是最新的toolchain版本?我现在应该改成 cl.exe的全路径才对。。要不你清下下 config cache试试? xmake f -c 或者删下 .xmake目录 |
我重新 checkout 最新的 toolchain 分支試試 |
可以么? |
我用 5683e06 測試,目前手邊平台全編譯了一次,都正常運作, good job 👍 |
非常感谢 |
当前xmake主要通过全局config配置唯一工具链,在特定target切换toolchain时候,支持不是很好。。
当前这个改进点,主要为了支持交叉编译时候,特定target还是走host工具链编译的场景,具体相关xmake.lua例子可以参考:
另外之前msvc的工具链的环境变量都是全局设置的,容易污染全局环境,也不方便切换,目前改为更加细粒度的envs绑定到os.execv上。只在对应的toolchain的runenvs进行绑定。。