-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
fix parse json_output #38
Conversation
xrepo.cmake
Outdated
@@ -355,7 +355,7 @@ function(xrepo_package package) | |||
endif() | |||
|
|||
message(STATUS "xrepo: ${_xrepo_cmdargs_${package_name}}") | |||
execute_process(COMMAND ${CMAKE_COMMAND} -E env --unset=CC --unset=CXX --unset=LD ${XREPO_CMD} install --yes ${verbose} ${XREPO_BUILD_PARALLEL_JOBS_STR} ${_xrepo_cmdargs} | |||
execute_process(COMMAND ${XREPO_CMD} install --yes ${verbose} ${XREPO_BUILD_PARALLEL_JOBS_STR} ${_xrepo_cmdargs} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why? $CC $LD will affect xrepo install
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果去掉CC/CXX,会使用系统默认的编译器,在交叉编译环境会有问题。
在我的cmake_toolchain中指定了编译器
set (CROSS_COMPILE /opt/gcc-arm-10.2-2020.11-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-)
set (CMAKE_C_COMPILER ${CROSS_COMPILE}gcc)
set (CMAKE_CXX_COMPILER ${CROSS_COMPILE}g++)
如果带上 --unset=CC --unset=CXX,在xrepo install package的时候,不会使用我指定的编译器,它会使用系统中的/usr/bin/gcc
去掉 --unset=CC --unset=CXX
,不管是native编译还是cross编译,都不会有问题。
--unset=CC --unset=CXX
只有在安装xmake的时候才应该使用,因为xmake是在本地运行的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果去掉CC/CXX,会使用系统默认的编译器,在交叉编译环境会有问题。
在我的cmake_toolchain中指定了编译器
目前不考虑对 cmake 中 cmake_toolchain 进行支持,这种分散指定 cc ld 在 xrepo install 支持是不可靠的,一些特定工具链的 flags 也没法指定 和安全切换。
要切工具链,按 xrepo-cmake 官方的方式整个切工具链。。
https://github.com/xmake-io/xrepo-cmake?tab=readme-ov-file#switching-compiler-and-cross-compilation
定义自定义工具链,在 XREPO_XMAKEFILE 里面,走 xmake 的 toolchain() 配置
--unset=CC --unset=CXX
这个是必须要,不要删,会 break 很多东西
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
另外,工具链问题,跟当前 json parse 问题 也是独立的,不应该混在一起提交
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK,工具链的问题,我还是用xmake的方式解决吧,我撤回这个提交
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
应该是没匹配上,这个pr 匹配的是gcc开头的工具,我这个是aarch 开头的。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
匹配问题 回头可以单独改进。
fix #37
fix syslinks override links