Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
6.2.2
-
macos
Description
我们用qt6_add_qml_module添加的模块在打双架构mac包时会出现链接错误,qt_add_qml_module 产生的模块,在上层target link这个module的时候,会往依赖target的other link 中添加对应的 .o 文件,这些理论上应该是不需要的,另外是生成这些.o的完整路径用到了 ARCH_STANDARD 属性,这个属性在双架构下带空格,会导致路径异常,cmake工程add target前设置 set(CMAKE_OSX_ARCHITECTURES "\$(ARCHS_STANDARD)") ,之后generator选xcode,可以产生构建双架构产物的xcode 工程,另外开asan的话,这些.o的路径也是不对的,这个地方是不是可以排查下,这些.o没必要暴露到上层二进制的链接,是不是add module里面这个link参数不小心给public到外部了
English:I am a pre-sales engineer of Qt China, this is the feedback from the engineer of our customer Bytedance company. When the module added by the customer with qt_add_qml_module will have a link error when using the dual-architecture mac package, the module generated by qt_add_qml_module will add the corresponding .o file to the other link that depends on the target when the module generated by qt_add_qml_module is in the upper-level target link. The above should not be needed. In addition, the ARCH_STANDARD attribute is used to generate the full path of these .o. This attribute has spaces under the dual architecture, which will cause the path to be abnormal. Set the set(CMAKE_OSX_ARCHITECTURES "\$(ARCHS_STANDARD) before the cmake project add target) "), then the generator selects xcode, which can generate xcode projects to build dual-architecture products. In addition, if asan is opened, these .o paths are also wrong. The customer here recommends Qt to check, these .o files do not need to be exposed to the upper binary. The link, is the link parameter in the add module accidentally public to the outside?