summaryrefslogtreecommitdiffstats
path: root/src/plugins/srtp/CMakeLists.txt
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2021-01-06 17:35:17 -0800
committerDave Wallace <dwallacelf@gmail.com>2021-05-25 21:18:54 +0000
commit6621abf49aec6d764e654316ff75274c75d4c1a1 (patch)
tree918ce456d904d3cf192e8f79ba6b8c6609f7129d /src/plugins/srtp/CMakeLists.txt
parent6bb77dec7074e6b7b27d6bc94238bcddda375a66 (diff)
srtp: basic implementation based on libsrtp2
Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ic5e99938a5f130e83de6d590d2f89252d055bceb
Diffstat (limited to 'src/plugins/srtp/CMakeLists.txt')
-rw-r--r--src/plugins/srtp/CMakeLists.txt41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/plugins/srtp/CMakeLists.txt b/src/plugins/srtp/CMakeLists.txt
new file mode 100644
index 00000000000..acbdf3177d8
--- /dev/null
+++ b/src/plugins/srtp/CMakeLists.txt
@@ -0,0 +1,41 @@
+# Copyright (c) 2021 Cisco and/or its affiliates.
+# Licensed 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 (CheckFunctionExists)
+
+vpp_plugin_find_library(srtp SRTP_LIB libsrtp2.a)
+
+if (NOT SRTP_LIB)
+ message(WARNING "srtp plugin - srtp2 lib not found - plugin disabled")
+ return()
+endif()
+
+vpp_find_path(SRTP_INCLUDE_DIR NAMES srtp2/srtp.h)
+
+if (NOT SRTP_INCLUDE_DIR)
+ message(WARNING "srtp plugin - srtp.h not found - plugin disabled")
+ return()
+endif()
+
+include_directories (${SRTP_INCLUDE_DIR})
+
+set(CMAKE_REQUIRED_FLAGS "-fPIC -shared -pthread -Wno-unused-command-line-argument ${SRTP_LIB}")
+set(CMAKE_REQUIRED_INCLUDES "${SRTP_INCLUDE_DIR}")
+
+add_vpp_plugin(srtp
+ SOURCES
+ srtp.c
+
+ LINK_LIBRARIES
+ ${SRTP_LIB}
+)