From a03619d03a9ca6605c8ea1d3638c2b10c954edf9 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Sat, 16 Dec 2017 19:11:56 -0800 Subject: Fixed Android warnings --- External/lua-5.2.3/CMakeLists.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'External/lua-5.2.3') diff --git a/External/lua-5.2.3/CMakeLists.txt b/External/lua-5.2.3/CMakeLists.txt index 78d2615..383bae8 100644 --- a/External/lua-5.2.3/CMakeLists.txt +++ b/External/lua-5.2.3/CMakeLists.txt @@ -86,6 +86,17 @@ if(MSVC) target_compile_options(Lua PRIVATE /W3 /wd4244 /wd4334 /wd4702) endif(MSVC) +if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR + CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + # Setting LANGUAGE to CXX is not enough for clang, so use -x c++ to compile c files as c++ and suppress + # the following warning: + # clang++.exe: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated] + target_compile_options(Lua PRIVATE -x c++) + + # For loslib.c, disable the following + # warning: 'tmpnam' is deprecated: tempnam is unsafe, use mkstemp or tmpfile instead [-Wdeprecated-declarations] + set_source_files_properties(src/loslib.c PROPERTIES COMPILE_FLAGS -Wno-deprecated-declarations) +endif() source_group("src" FILES ${SOURCE}) source_group("include" FILES ${INCLUDE}) -- cgit v1.2.3