ago*_*dis 9 compilation cmake demangler ninja swift
在Mac机器上编译Swift时,会libswiftDemangle.dylib创建一个动态库.我也需要在Linux机器上创建的动态库,但是,在编译源代码之后不会创建动态库.
该文件CMakeLists.txt在lib/SwiftDemangle/CMakeLists.txt包含:
add_swift_library(swiftDemangle SHARED
SwiftDemangle.cpp
MangleHack.cpp
LINK_LIBRARIES swiftBasic)
Run Code Online (Sandbox Code Playgroud)
指令,但是没有创建库.
我使用此命令./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
Run Code Online (Sandbox Code Playgroud)
要在该目录中构建组织在子目录中的库,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)
Run Code Online (Sandbox Code Playgroud)
正如你所看到的,
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
add_subdirectory(SwiftDemangle)
endif()
Run Code Online (Sandbox Code Playgroud)
阻止SwiftDemangle在 Linux 上构建。
表面的双重检查可以是:
https://github.com/apple/swift/blob/master/lib/SwiftDemangle/CMakeLists.txt
Run Code Online (Sandbox Code Playgroud)
它将仅安装或 simlynk*.dylib文件。
值得一提的是,该swift-demangle工具(与您要求的不同)
https://github.com/apple/swift/tree/master/tools/swift-demangle
Run Code Online (Sandbox Code Playgroud)
是在 Linux 上构建的。
| 归档时间: |
|
| 查看次数: |
257 次 |
| 最近记录: |