You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by jr...@apache.org on 2017/10/27 14:16:59 UTC

[6/6] qpid-cpp git commit: QPID-7860: Fix swig deprecation warnings

QPID-7860: Fix swig deprecation warnings


Project: http://git-wip-us.apache.org/repos/asf/qpid-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-cpp/commit/2349e0b7
Tree: http://git-wip-us.apache.org/repos/asf/qpid-cpp/tree/2349e0b7
Diff: http://git-wip-us.apache.org/repos/asf/qpid-cpp/diff/2349e0b7

Branch: refs/heads/master
Commit: 2349e0b79c9204b5ed37ec2a1b44625e1c46cc6d
Parents: 3b78933
Author: Justin Ross <jr...@apache.org>
Authored: Thu Sep 21 17:09:37 2017 -0700
Committer: Justin Ross <jr...@apache.org>
Committed: Fri Oct 27 07:00:39 2017 -0700

----------------------------------------------------------------------
 CMakeModules/FindSWIG.cmake         | 43 ++++++++++++++++++++++++++++++++
 bindings/qmf2/python/CMakeLists.txt |  2 +-
 bindings/qmf2/ruby/CMakeLists.txt   |  2 +-
 bindings/qpid/perl/CMakeLists.txt   |  2 +-
 bindings/qpid/python/CMakeLists.txt |  2 +-
 bindings/qpid/ruby/CMakeLists.txt   |  2 +-
 6 files changed, 48 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-cpp/blob/2349e0b7/CMakeModules/FindSWIG.cmake
----------------------------------------------------------------------
diff --git a/CMakeModules/FindSWIG.cmake b/CMakeModules/FindSWIG.cmake
new file mode 100644
index 0000000..979ebab
--- /dev/null
+++ b/CMakeModules/FindSWIG.cmake
@@ -0,0 +1,43 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+include(${CMAKE_ROOT}/Modules/FindSWIG.cmake)
+
+if (NOT COMMAND swig_add_library)
+  macro (SWIG_ADD_LIBRARY name)
+    set(options "")
+    set(oneValueArgs LANGUAGE TYPE)
+    set(multiValueArgs SOURCES)
+    cmake_parse_arguments(_SAM "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+
+    if (NOT DEFINED _SAM_LANGUAGE)
+      message(FATAL_ERROR "SWIG_ADD_LIBRARY: Missing LANGUAGE argument")
+    endif ()
+
+    if (NOT DEFINED _SAM_SOURCES)
+      message(FATAL_ERROR "SWIG_ADD_LIBRARY: Missing SOURCES argument")
+    endif ()
+
+    if (DEFINED _SAM_TYPE AND NOT _SAM_LANGUAGE STREQUAL "module")
+      message(FATAL_ERROR "SWIG_ADD_LIBRARY: This fallback impl of swig_add_library supports the module type only")
+    endif ()
+
+    swig_add_module(${name} ${_SAM_LANGUAGE} ${_SAM_SOURCES})
+  endmacro ()
+endif (NOT COMMAND swig_add_library)

http://git-wip-us.apache.org/repos/asf/qpid-cpp/blob/2349e0b7/bindings/qmf2/python/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/bindings/qmf2/python/CMakeLists.txt b/bindings/qmf2/python/CMakeLists.txt
index 3acd583..2ab1d7d 100644
--- a/bindings/qmf2/python/CMakeLists.txt
+++ b/bindings/qmf2/python/CMakeLists.txt
@@ -32,7 +32,7 @@ list(APPEND SWIG_MODULE_cqmf2_EXTRA_DEPS
     ${CMAKE_SOURCE_DIR}/include/qmf/qmf2.i
     ${CMAKE_SOURCE_DIR}/include/qpid/swig_python_typemaps.i
 )
-swig_add_module(cqmf2 python ${CMAKE_CURRENT_SOURCE_DIR}/cqmf2.i)
+swig_add_library(cqmf2 LANGUAGE python SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/cqmf2.i)
 swig_link_libraries(cqmf2 qmf2 qpidmessaging qpidtypes ${PYTHON_LIBRARIES})
 
 set_source_files_properties(${swig_generated_file_fullname} PROPERTIES COMPILE_FLAGS "${NOSTRICT_ALIASING}")

http://git-wip-us.apache.org/repos/asf/qpid-cpp/blob/2349e0b7/bindings/qmf2/ruby/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/bindings/qmf2/ruby/CMakeLists.txt b/bindings/qmf2/ruby/CMakeLists.txt
index 74fe777..e167177 100644
--- a/bindings/qmf2/ruby/CMakeLists.txt
+++ b/bindings/qmf2/ruby/CMakeLists.txt
@@ -36,7 +36,7 @@ list(APPEND SWIG_MODULE_cqmf2_ruby_EXTRA_DEPS
     ${CMAKE_SOURCE_DIR}/include/qmf/qmf2.i
     ${CMAKE_SOURCE_DIR}/include/qpid/swig_ruby_typemaps.i
 )
-swig_add_module(cqmf2_ruby ruby ${CMAKE_CURRENT_SOURCE_DIR}/ruby.i)
+swig_add_library(cqmf2_ruby LANGUAGE ruby SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/ruby.i)
 swig_link_libraries(cqmf2_ruby qmf2 qpidmessaging qpidtypes ${RUBY_LIBRARY})
 
 ##----------------------------------

http://git-wip-us.apache.org/repos/asf/qpid-cpp/blob/2349e0b7/bindings/qpid/perl/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/bindings/qpid/perl/CMakeLists.txt b/bindings/qpid/perl/CMakeLists.txt
index 3c859d6..b71a545 100644
--- a/bindings/qpid/perl/CMakeLists.txt
+++ b/bindings/qpid/perl/CMakeLists.txt
@@ -28,7 +28,7 @@ list(APPEND SWIG_MODULE_cqpid_perl_EXTRA_DEPS
     ${CMAKE_CURRENT_SOURCE_DIR}/../../../include/qpid/qpid.i
     ${CMAKE_CURRENT_SOURCE_DIR}/../../../include/qpid/swig_perl_typemaps.i
 )
-swig_add_module(cqpid_perl perl ${CMAKE_CURRENT_SOURCE_DIR}/perl.i)
+swig_add_library(cqpid_perl LANGUAGE perl SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/perl.i)
 swig_link_libraries(cqpid_perl qpidmessaging qpidtypes ${PERL_LIBRARY})
 set_source_files_properties(${swig_generated_file_fullname} PROPERTIES COMPILE_FLAGS "${NOSTRICT_ALIASING}")
 

http://git-wip-us.apache.org/repos/asf/qpid-cpp/blob/2349e0b7/bindings/qpid/python/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/bindings/qpid/python/CMakeLists.txt b/bindings/qpid/python/CMakeLists.txt
index ac1998b..fc251ba 100644
--- a/bindings/qpid/python/CMakeLists.txt
+++ b/bindings/qpid/python/CMakeLists.txt
@@ -32,7 +32,7 @@ list(APPEND SWIG_MODULE_qpid_messaging_EXTRA_DEPS
     ${CMAKE_SOURCE_DIR}/include/qpid/qpid.i
     ${CMAKE_SOURCE_DIR}/include/qpid/swig_python_typemaps.i
 )
-swig_add_module(qpid_messaging python ${CMAKE_CURRENT_SOURCE_DIR}/qpid_messaging.i)
+swig_add_library(qpid_messaging LANGUAGE python SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/qpid_messaging.i)
 swig_link_libraries(qpid_messaging qpidmessaging qpidtypes ${PYTHON_LIBRARIES})
 set_source_files_properties(${swig_generated_file_fullname} PROPERTIES COMPILE_FLAGS "${NOSTRICT_ALIASING}")
 

http://git-wip-us.apache.org/repos/asf/qpid-cpp/blob/2349e0b7/bindings/qpid/ruby/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/bindings/qpid/ruby/CMakeLists.txt b/bindings/qpid/ruby/CMakeLists.txt
index c31b4d4..c0e9e62 100644
--- a/bindings/qpid/ruby/CMakeLists.txt
+++ b/bindings/qpid/ruby/CMakeLists.txt
@@ -45,7 +45,7 @@ list(APPEND SWIG_MODULE_cqpid_ruby_EXTRA_DEPS
     ${CMAKE_SOURCE_DIR}/include/qpid/qpid.i
     ${CMAKE_SOURCE_DIR}/include/qpid/swig_ruby_typemaps.i
 )
-swig_add_module(cqpid_ruby ruby ${CMAKE_CURRENT_SOURCE_DIR}/ruby.i)
+swig_add_library(cqpid_ruby LANGUAGE ruby SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/ruby.i)
 swig_link_libraries(cqpid_ruby qpidmessaging qpidtypes ${RUBY_LIBRARY})
 
 set_source_files_properties(${swig_generated_file_fullname} PROPERTIES COMPILE_FLAGS "${NOSTRICT_ALIASING}")


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org