Linux上的libswiftDemangle.so
在Mac机器上编译
Swift时,创建了一个动态库libswiftDemangle.dylib.我也需要在
Linux机器上创建的动态库,但是,在编译源代码之后不会创建动态库.
lib / SwiftDemangle / CMakeLists.txt中的文件CMakeLists.txt包含: add_swift_library(swiftDemangle SHARED SwiftDemangle.cpp MangleHack.cpp LINK_LIBRARIES swiftBasic) 指令,但是没有创建库. 我使用这个命令./swift/utils/build-script -R -c –build-subdir build –install-prefix / mnt / servers / swift / install -j4来构建项目,最终它运行cmake和ninja到建立项目. 有任何想法吗? 解决方法
我可以尝试解释为什么这个库没有在Linux上构建,即使它可能已经很晚了.
包含您提到的库的主子目录是: https://github.com/apple/swift/tree/master/lib 要在该目录中构建libs(在子目录中组织),使用以下CMakeLists.txt: https://github.com/apple/swift/blob/master/lib/CMakeLists.txt. 从这个文件中可以清楚地看到,你提到的库只有在系统是OSX / Darwin而不是Linux的情况下才能构建.上述CMakeLists.txt中的相关代码是: add_subdirectory(RemoteAST) add_subdirectory(Sema) add_subdirectory(Serialization) if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") add_subdirectory(SwiftDemangle) endif() add_subdirectory(SIL) add_subdirectory(SILGen) 你可以看到它, if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") add_subdirectory(SwiftDemangle) endif() 防止SwiftDemangle在Linux上构建. https://github.com/apple/swift/blob/master/lib/SwiftDemangle/CMakeLists.txt 它将仅安装或simlynk * .dylib文件. https://github.com/apple/swift/tree/master/tools/swift-demangle 是建立在Linux上的. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |