Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Macosx接入XLua的时候报了编译错误 #47

Closed
Colocasia opened this issue Mar 18, 2020 · 3 comments
Closed

Macosx接入XLua的时候报了编译错误 #47

Colocasia opened this issue Mar 18, 2020 · 3 comments

Comments

@Colocasia
Copy link

image
看起来是这一块:
image

namespace details {
	rapidjson::Value toValue(lua_State* L, int idx, int depth, Allocator& allocator);
}

inline rapidjson::Value toValue(lua_State* L, int idx, Allocator& allocator) {
	return details::toValue(L, idx, 0, allocator);
}
@Colocasia
Copy link
Author

我试了一下,0.5.0以前可以接入。之后版本会报以上编译错误。

@xpol
Copy link
Owner

xpol commented Mar 22, 2020

应该是这段CMake配置没有设置:

if(${CMAKE_VERSION} VERSION_LESS "3.1.0")
    if(CMAKE_COMPILER_IS_GNUCXX)
        execute_process(COMMAND "${CMAKE_CXX_COMPILER} -dumpversion" OUTPUT_VARIABLE GCC_VERSION)
        if (GCC_VERSION VERSION_LESS 4.7)
            set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
        else()
            set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
        endif()
    endif()
else()
    target_compile_features(lua-rapidjson PRIVATE cxx_rvalue_references)
endif()

要么粗暴地开启 C++11 要么开启 cxx_rvalue_references 。

@xpol xpol closed this as completed Mar 22, 2020
@lizhaodong2318
Copy link

所以这段配置要写在那个文件的哪个位置

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants