changeset 58:438e592d70c5

libopus: initial import
author David Demelier <markand@malikania.fr>
date Fri, 10 Mar 2023 14:03:38 +0100
parents 893bec5b4667
children d322c18c62c2
files libopus.md libopus/opus_buildtype.cmake
diffstat 2 files changed, 62 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libopus.md	Fri Mar 10 14:03:38 2023 +0100
@@ -0,0 +1,39 @@
+Build libopus
+=============
+
+Version: 1.3.1
+
+Download
+--------
+
+- https://archive.mozilla.org/pub/opus/opus-1.3.1.tar.gz
+- https://raw.githubusercontent.com/bincrafters/conan-opus/stable/1.3.1/opus_buildtype.cmake
+
+Configure
+---------
+
+### Visual Studio (debug)
+
+	copy libopus/opus_buildtype.cmake .
+	cmake -S . -B build
+		-DCMAKE_BUILD_TYPE=Debug
+		-DCMAKE_INSTALL_PREFIX=C:/pkg/vs/debug
+		-G"NMake Makefiles"
+
+### Visual Studio (release)
+
+	copy libopus/opus_buildtype.cmake .
+	cmake -S . -B build
+		-DCMAKE_BUILD_TYPE=Release
+		-DCMAKE_INSTALL_PREFIX=C:/pkg/vs/release
+		-DBUILD_SHARED_LIBS=On
+		-DOPUS_BUILD_PROGRAMS=Off
+		-DOPUS_INSTALL_PKG_CONFIG_MODULE=Off
+		-G"NMake Makefiles"
+
+Build
+-----
+
+### Visual Studio
+
+	cmake --build build && cmake --install build
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libopus/opus_buildtype.cmake	Fri Mar 10 14:03:38 2023 +0100
@@ -0,0 +1,23 @@
+# Set a default build type if none was specified
+
+if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
+  if(CMAKE_C_FLAGS)
+    message(STATUS "CMAKE_C_FLAGS: " ${CMAKE_C_FLAGS})
+  else()
+    set(default_build_type "Release")
+    message(
+      STATUS
+        "Setting build type to '${default_build_type}' as none was specified and no CFLAGS was exported."
+      )
+    set(CMAKE_BUILD_TYPE "${default_build_type}"
+        CACHE STRING "Choose the type of build."
+        FORCE)
+    # Set the possible values of build type for cmake-gui
+    set_property(CACHE CMAKE_BUILD_TYPE
+                 PROPERTY STRINGS
+                          "Debug"
+                          "Release"
+                          "MinSizeRel"
+                          "RelWithDebInfo")
+  endif()
+endif()