- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我正在尝试使用 XCode 将 OpenSSL 库静态链接到我的 Swift 框架。网上提到的大多数方法都不正确,因为它们建议使用导入路径(SWIFT_INCLUDE_PATHS
)。因此,框架二进制文件被锁定到文件系统中的特定位置,二进制文件本身不可移植。虽然这不是世界末日,但我仍然希望能够通过 Carthage 分发二进制文件,而遵循上述方法并不能实现这一点。
我尝试使用框架的伞头文件创建自己的模块映射,并将 OpenSSL 库作为显式模块包括在内,遵循以下文章中描述的方法:https://badootech.badoo.com/bundling-c-library-in-swift-framework-3d9dae950774
这是我的模块映射文件,我将其路径插入到 MODULEMAP_FILE
中构建配置变量。
framework module MyFramework {
umbrella header "MyFramework.h"
requires objc
export *
module * { export * }
module COpenSSL [system] {
header "shim.h"
link "ssl"
link "crypto"
export *
}
}
哪里shim.h
文件是一个头文件,看起来像这样:
#ifndef __COPENSSL_SHIM_H__
#define __COPENSSL_SHIM_H__
#include <openssl/conf.h>
#include <openssl/evp.h>
#include <openssl/err.h>
#include <openssl/bio.h>
#include <openssl/ssl.h>
#include <openssl/md4.h>
#include <openssl/md5.h>
#include <openssl/sha.h>
#include <openssl/hmac.h>
#include <openssl/rand.h>
#include <openssl/ripemd.h>
#include <openssl/pkcs12.h>
#include <openssl/x509v3.h>
__attribute__((swift_name("SSL_set_tlsext_host_name(_:_:)")))
static inline int shim_SSL_set_tlsext_host_name(const SSL *s, const char *name) {
return SSL_set_tlsext_host_name(s, name);
};
#endif
这里的问题是,我在尝试编译有关包含非模块化 header 的项目时遇到错误。
我试图将所有头文件作为公共(public)头文件( conf.h
、 evp.h
等)包含到 XCode 项目中。但问题仍然存在,大概是因为它无法使用 header 包含的语法 #include <openssl/conf.h>
.将夹杂物更改为 #include "conf.h"
等工作,但随后将相同样式的 header 包含用于 conf.h
以及来自 Open SSL 库的所有其他头文件,所以这并没有真正帮助。
我真的不想为了让它工作而修改 OpenSSL 库中的每个头文件,看来必须有一些更简单的方法来解决这个问题。
有没有办法不必将这些 header 包含到 XCode 项目中,以便它们仍然可以使用 #include <openssl/conf.h>
的原始语法? ?
我试过设置 HEADER_SEARCH_PATHS
到每个 header 的相对路径为 openssl/conf.h
的路径等等,但它根本没有帮助。
谢谢。
最佳答案
最后,我找不到比将所有必需的 header 列到模块映射中并重写来自 <>
的 SSL 库文件的包含宏更好的解决方案了。只是普通包含的语法。我使用这个小 shell 脚本来帮助我:
sed -E -i '' 's/#[[:space:]]*include <openssl\/(.*).h>/#include \"\1\.h"/' $SCRIPT_DIR/../Libraries/openssl/include/openssl/*.h
关于swift - 将 modulemap 用于 Swift 框架时 OpenSSL 库的非模块化 header ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56599824/
我需要开发一个简单的网站,我通常使用 bootstrap CSS 框架,但是我想使用 Gumbyn,它允许我使用 16 列而不是 12 列。 我想知道是否: 我可以轻松地改变绿色吗? 如何使用固定布局
这个问题在这里已经有了答案: 关闭 13 年前。 与直接编写 PHP 代码相比,使用 PHP 框架有哪些优点/缺点?
我开发了一个 Spring/JPA 应用程序:服务、存储库和域层即将完成。 唯一缺少的层是网络层。我正在考虑将 Playframework 2.0 用于 Web 层,但我不确定是否可以在我的 Play
我现有的 struts Web 应用程序具有单点登录功能。然后我将使用 spring 框架创建一个不同的 Web 应用程序。然后想要使用从 struts 应用程序登录的用户来链接新的 spring 应
我首先使用Spark框架和ORMLite处理网页上表单提交的数据,在提交中文字符时看到了unicode问题。我首先想到问题可能是由于ORMLite,因为我的MySQL数据库的字符集已设置为使用utf8
我有一个使用 .Net 4.5 功能的模块,我们的应用程序也适用于 XP 用户。所以我正在考虑将这个 .net 4.5 依赖模块移动到单独的项目中。我怎样才能有一个解决方案,其中有两个项目针对不同的版
我知道这是一个非常笼统的问题,但我想我并不是真的在寻找明确的答案。作为 PHP 框架的新手,我很难理解它。 Javascript 框架,尤其是带有 UI 扩展的框架,似乎通过将 JS 代码与设计分开来
我需要收集一些关于现有 ORM 解决方案的信息。 请随意编写任何编程语言。 你能谈谈你用过的最好的 ORM 框架吗?为什么它比其他的更好? 最佳答案 我使用了 NHibernate 和 Entity
除了 Apple 的 SDK 之外,还有什么强大的 iPhone 框架可供开始开发?有没有可以加快开发时间的方法? 最佳答案 此类框架最大的是Three20 。 Facebook 和许多其他公司都使用
有人可以启发我使用 NodeJS 的 Web 框架吗?我最近开始从免费代码营学习express js,虽然一切进展顺利,但我对express到底是什么感到困惑。是全栈框架吗?纯粹是为了后端吗?我发现您
您可以推荐哪种 Ajax 框架/工具包来构建使用 struts 的 Web 应用程序的 GUI? 最佳答案 我会说你的 AJAX/javascript 库选择应该较少取决于你的后端是如何实现的,而更多
我有生成以下错误的 python 代码: objc[36554]: Class TKApplication is implemented in both /Library/Frameworks/Tk.
首先,很抱歉,如果我问的问题很明显,因为我没有编程背景,那我去吧: 我想运行一系列测试场景并在背景部分声明了几个变量(我打印它们以仔细检查它们是否已正确声明),第一个是整数,另外两个字符串为你可以看到
在我们承担的一个项目中,我们正在寻找一个视频捕获和录制库。我们的基础工作(基于 google 搜索)表明 vlc (libvlc)、ffmpeg (libavcodec) 和 gstreamer 是三
我试过没有运气的情况下寻找某种功能来杀死/中断Play中的正常工作!框架。 我想念什么吗?还是玩了!实际没有添加此功能? 最佳答案 Java stop类中没有像Thread方法那样的东西,由于种种原因
我们希望在我们的系统中保留所有重大事件的记录。例如,在数据库可能存储当前用户状态的地方,事件日志应记录对该状态的所有更改以及更改发生的时间。 事件记录工具应该尽可能接近于事件引发器的零开销,应该容纳结
那里有 ActionScript 2.0/3.0 的测试框架列表吗? 最佳答案 2010-05-18 更新 由于这篇文章有点旧,而且我刚刚收到了赞成票,因此可能值得提供一些更新的信息,这样人们就不会追
我有一个巨大的 numpy 数组列表(一维),它们是不同事件的时间序列。每个点都有一个标签,我想根据其标签对 numpy 数组进行窗口化。我的标签是 0、1 和 2。每个窗口都有一个固定的大小 M。
我是 Play 的新手!并编写了我的第一个应用程序。这个应用程序有一组它依赖的 URL,从 XML 响应中提取数据并返回有效的 URL。 此应用程序需要在不同的环境(Dev、Staging 和 Pro
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 4年前关闭。 Improve thi
我是一名优秀的程序员,十分优秀!