Skip to content

Commit 4555b20

Browse files
committed
Fix Clang build.
1 parent cf671f6 commit 4555b20

File tree

3 files changed

+25
-12
lines changed

3 files changed

+25
-12
lines changed

CMakeLists.txt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,15 @@ else()
3535
"-Wsign-conversion" "-Wsign-promo"
3636
"-Wstrict-null-sentinel" "-Wstrict-overflow=5"
3737
"-Wno-deprecated-declarations") # auto_ptr is OK for now.
38-
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND NOT LUABIND_NO_CXX11)
39-
# I do not know (a) since when Clang supports this flags and (b) how to
40-
# check Clang's version. Use LUABIND_NO_CXX11 manually if you need to.
41-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++")
38+
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
39+
add_definitions("-Weverything" "-Wno-shadow" "-Wno-undef"
40+
"-Wno-global-constructors" "-Wno-weak-vtables"
41+
"-Wno-padded" "-Wno-exit-time-destructors")
42+
if (NOT LUABIND_NO_CXX11)
43+
# I do not know (a) since when Clang supports this flags and (b) how to
44+
# check Clang's version. Use LUABIND_NO_CXX11 manually if you need to.
45+
add_definitions("-std=c++11" "-Wno-c++98-compat")
46+
endif()
4247
endif ()
4348
endif()
4449

luabind/detail/format_signature.hpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,13 @@
77

88
# include <luabind/config.hpp>
99
# include <luabind/lua_include.hpp>
10+
# include <luabind/object_fwd.hpp>
1011
# include <luabind/typeid.hpp>
1112

1213
# include <boost/mpl/begin_end.hpp>
1314
# include <boost/mpl/next.hpp>
1415
# include <boost/mpl/size.hpp>
1516

16-
namespace luabind {
17-
18-
class object;
19-
class argument;
20-
template <class Base>
21-
struct table;
22-
23-
} // namespace luabind
2417

2518
namespace luabind { namespace detail {
2619

luabind/object_fwd.hpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#ifndef LUABIND_OBJECT_FWD_050419_HPP
2+
#define LUABIND_OBJECT_FWD_050419_HPP
3+
4+
namespace luabind {
5+
namespace adl {
6+
class object;
7+
class argument;
8+
template <class Base> struct table;
9+
} // namespace adl
10+
using adl::object;
11+
using adl::argument;
12+
using adl::table;
13+
} // namespace luabind
14+
15+
#endif

0 commit comments

Comments
 (0)