Only disable register warnings for SWIG 2.

SWIG 3 has removed the register storage class markers.
This commit is contained in:
John Ralls 2018-11-30 16:11:42 +09:00
parent e81bcf6e33
commit 3f09e5c6f1

View File

@ -288,6 +288,7 @@ endif (WIN32)
if(GENERATE_SWIG_WRAPPERS)
find_package (SWIG 2.0.10 REQUIRED)
include (${SWIG_USE_FILE})
string(REGEX MATCH "^[0-9]+\." SWIG_MAJOR ${SWIG_VERSION})
endif()
# Find Guile and determine which version we are using.
@ -547,6 +548,8 @@ check_c_compiler_flag(-Wstringop-truncation have_stringop_truncation)
if (have_stringop_truncation)
set(HAVE_STRINGOP_TRUNCATION TRUE)
endif()
if (SWIG_MAJOR LESS 3)
check_cxx_compiler_flag(-Wno-register have_no_register)
if (have_no_register)
set(REGISTER_CXXFLAG -Wno-register)
@ -556,6 +559,7 @@ else()
set(REGISTER_CXXFLAG -Wno-deprecated-register)
endif()
endif()
endif()
add_definitions(-D_GNU_SOURCE)
if (APPLE)