Replies: 2 comments 1 reply
-
xmake f -vD -c 看下检测失败信息。 |
Beta Was this translation helpful? Give feedback.
1 reply
-
重新看了一下文档解决了,发现是格式问题 configvar_check_cxxfuncs ("HAVE_STRCASECMP", "strcasecmp", {includes = {"strings.h"}})
configvar_check_cxxfuncs ("HAVE__STRICMP", "_stricmp", {includes = {"string.h"}})
configvar_check_cxxfuncs ("HAVE_SNPRINTF", "snprintf", {includes = {"stdio.h"}})
configvar_check_cxxfuncs ("HAVE__SNPRINTF", "_snprintf", {includes = {"stdio.h"}}) 像上面那样写就对了。官方文档用的是下面的例子,我下意识认为只有一个头文件时是可以忽略的,建议可以加一个单个头文件的例子。 includes("check_cfuncs.lua")
target("test")
set_kind("binary")
add_files("*.c")
add_configfiles("config.h.in")
configvar_check_cfuncs("HAS_SETJMP", "setjmp", {includes = {"signal.h", "setjmp.h"}}) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
最近在使用xmake,用到了libssh2库,需要针对Windows下缺乏POSIX函数做处理,在[样例]中(https://github.com/libssh2/libssh2/blob/master/example/CMakeLists.txt)中,用到了CMake的[check_symbol_exists](https://cmake.org/cmake/help/v3.13/module/CheckSymbolExists.html)功能,如下:
经过查阅文档,发现已经适配了相应的功能#342
#1715,但是当我使用时,遇到了一些麻烦,不知道是否是我的问题还是lua脚本对MSVC的适配有问题。下面是我的环境
我是类似下面的用法
配置文件
/* Functions */ ${define HAVE_STRCASECMP} ${define HAVE__STRICMP} ${define HAVE_SNPRINTF} ${define HAVE__SNPRINTF}
在头文件
string.h
中有但是最终生成的配置文件并没有检测到
_stricmp
函数Beta Was this translation helpful? Give feedback.
All reactions