Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simde unvendor #23

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/scripts/utils.zsh/setup_linux
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ sudo apt-get install -y --no-install-recommends \
libasound2-dev libfdk-aac-dev libfontconfig-dev libfreetype6-dev libjack-jackd2-dev \
libpulse-dev libsndio-dev libspeexdsp-dev libudev-dev libv4l-dev libva-dev libvlc-dev \
libpci-dev libdrm-dev \
nlohmann-json3-dev libwebsocketpp-dev libasio-dev libvpl-dev libvpl2 libqrcodegencpp-dev
nlohmann-json3-dev libwebsocketpp-dev libasio-dev libvpl-dev libvpl2 libqrcodegencpp-dev \
libsimde-dev

if (( UBUNTU_2210_OR_LATER )) sudo apt-get install -y --no-install-recommends librist-dev libsrt-openssl-dev

Expand Down
1 change: 1 addition & 0 deletions build-aux/com.obsproject.Studio.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"modules/50-v4l-utils.json",
"modules/90-asio.json",
"modules/90-nlohmann-json.json",
"modules/90-simde.json",
"modules/90-websocketpp.json",
"modules/99-cef.json",
{
Expand Down
16 changes: 16 additions & 0 deletions build-aux/modules/90-simde.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "simde",
"buildsystem": "meson",
"builddir": true,
"config-opts": [
"-Dtests=false"
],
"sources": [
{
"type": "git",
"url": "https://github.com/simd-everywhere/simde.git",
"tag": "v0.8.0",
"commit": "589c7d599ae2213823acc4334a3ae8ef8caefe18"
}
]
}
10 changes: 5 additions & 5 deletions buildspec.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"dependencies": {
"prebuilt": {
"version": "2024-03-19",
"baseUrl": "https://github.com/obsproject/obs-deps/releases/download",
"version": "2024-03-29",
"baseUrl": "https://github.com/tytan652/obs-deps/releases/download",
"label": "Pre-Built obs-deps",
"hashes": {
"macos-universal": "2e9bfb55a5e0e4c1086fa1fda4cf268debfead473089df2aaea80e1c7a3ca7ff",
"windows-x64": "6e86068371526a967e805f6f9903f9407adb683c21820db5f07da8f30d11e998",
"windows-x86": "1002a7a19c55a6eb3cd0fb9c4c6d6bb1d649176439b6705e4bb5bd12948456a0"
"macos-universal": "5e6888d0566bbe0cfdacd630554bbc3b47f83b538430c68a3e34a9e824a42770",
"windows-x64": "0b56c9ac46295fbae6ed9f3809977d60a986c0a05bdf20d74d9aeb0173aace41",
"windows-x86": "16abd4e9105b5d72cbcdb5fc9d392b50c6a297eca529f5b0713023768bd49998"
}
},
"qt6": {
Expand Down
98 changes: 98 additions & 0 deletions cmake/Modules/FindSimde.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
#[=======================================================================[.rst
FindSimde
--------

FindModule for simde and the associated library

Imported Targets
^^^^^^^^^^^^^^^^

.. versionadded:: 3.0

This module defines the :prop_tgt:`IMPORTED` target ``Simde::Simde``.

Result Variables
^^^^^^^^^^^^^^^^

This module sets the following variables:

``Simde_FOUND``
True, if the library was found.
``Simde_VERSION``
Detected version of found simde library.

Cache variables
^^^^^^^^^^^^^^^

The following cache variables may also be set:

``Simde_INCLUDE_DIR``
Directory containing ``simde/simde-common.h``.

#]=======================================================================]

# cmake-format: off
# cmake-lint: disable=C0103
# cmake-lint: disable=C0301
# cmake-format: on

include(FindPackageHandleStandardArgs)

find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND)
pkg_search_module(PC_Simde QUIET simde)
endif()

find_path(
Simde_INCLUDE_DIR
NAMES simde/simde-common.h
HINTS ${PC_Simde_INCLUDE_DIRS}
PATHS /usr/include /usr/local/include
DOC "simde include directory")

if(PC_Simde_VERSION VERSION_GREATER 0)
set(Simde_VERSION ${PC_Simde_VERSION})
elseif(EXISTS "${Simde_INCLUDE_DIR}/simde/simde-common.h")
file(STRINGS "${Simde_INCLUDE_DIR}/simde/simde-common.h" _version_string
REGEX "^.*VERSION_(MAJOR|MINOR|MICRO)[ \t]+[0-9]+[ \t]*$")

string(REGEX REPLACE ".*VERSION_MAJOR[ \t]+([0-9]+).*" "\\1" _version_major "${_version_string}")
string(REGEX REPLACE ".*VERSION_MINOR[ \t]+([0-9]+).*" "\\1" _version_minor "${_version_string}")
string(REGEX REPLACE ".*VERSION_MICRO[ \t]+([0-9]+).*" "\\1" _version_micro "${_version_string}")

set(Simde_VERSION "${_version_major}.${_version_minor}.${_version_micro}")
unset(_version_major)
unset(_version_minor)
unset(_version_micro)
else()
if(NOT Simde_FIND_QUIETLY)
message(AUTHOR_WARNING "Failed to find simde version.")
endif()
set(Simde_VERSION 0.0.0)
endif()

if(CMAKE_HOST_SYSTEM_NAME MATCHES "Darwin|Windows")
set(Simde_ERROR_REASON "Ensure that obs-deps is provided as part of CMAKE_PREFIX_PATH.")
elseif(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|FreeBSD")
set(Simde_ERROR_REASON "Ensure simde library is available in local include paths.")
endif()

find_package_handle_standard_args(
Simde
REQUIRED_VARS Simde_INCLUDE_DIR
VERSION_VAR Simde_VERSION REASON_FAILURE_MESSAGE "${Simde_ERROR_REASON}")
mark_as_advanced(Simde_INCLUDE_DIR)
unset(Simde_ERROR_REASON)

if(Simde_FOUND)
if(NOT TARGET Simde::Simde)
add_library(Simde::Simde INTERFACE IMPORTED)
set_target_properties(Simde::Simde PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${Simde_INCLUDE_DIR}")
endif()
endif()

include(FeatureSummary)
set_package_properties(
Simde PROPERTIES
URL "https://simd-everywhere.github.io/blog/"
DESCRIPTION "Implementations of SIMD instruction sets for systems which don't natively support them.")
98 changes: 98 additions & 0 deletions cmake/finders/FindSimde.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
#[=======================================================================[.rst
FindSimde
--------

FindModule for simde and the associated library

Imported Targets
^^^^^^^^^^^^^^^^

.. versionadded:: 3.0

This module defines the :prop_tgt:`IMPORTED` target ``Simde::Simde``.

Result Variables
^^^^^^^^^^^^^^^^

This module sets the following variables:

``Simde_FOUND``
True, if the library was found.
``Simde_VERSION``
Detected version of found simde library.

Cache variables
^^^^^^^^^^^^^^^

The following cache variables may also be set:

``Simde_INCLUDE_DIR``
Directory containing ``simde/simde-common.h``.

#]=======================================================================]

# cmake-format: off
# cmake-lint: disable=C0103
# cmake-lint: disable=C0301
# cmake-format: on

include(FindPackageHandleStandardArgs)

find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND)
pkg_search_module(PC_Simde QUIET simde)
endif()

find_path(
Simde_INCLUDE_DIR
NAMES simde/simde-common.h
HINTS ${PC_Simde_INCLUDE_DIRS}
PATHS /usr/include /usr/local/include
DOC "simde include directory")

if(PC_Simde_VERSION VERSION_GREATER 0)
set(Simde_VERSION ${PC_Simde_VERSION})
elseif(EXISTS "${Simde_INCLUDE_DIR}/simde/simde-common.h")
file(STRINGS "${Simde_INCLUDE_DIR}/simde/simde-common.h" _version_string
REGEX "^.*VERSION_(MAJOR|MINOR|MICRO)[ \t]+[0-9]+[ \t]*$")

string(REGEX REPLACE ".*VERSION_MAJOR[ \t]+([0-9]+).*" "\\1" _version_major "${_version_string}")
string(REGEX REPLACE ".*VERSION_MINOR[ \t]+([0-9]+).*" "\\1" _version_minor "${_version_string}")
string(REGEX REPLACE ".*VERSION_MICRO[ \t]+([0-9]+).*" "\\1" _version_micro "${_version_string}")

set(Simde_VERSION "${_version_major}.${_version_minor}.${_version_micro}")
unset(_version_major)
unset(_version_minor)
unset(_version_micro)
else()
if(NOT Simde_FIND_QUIETLY)
message(AUTHOR_WARNING "Failed to find simde version.")
endif()
set(Simde_VERSION 0.0.0)
endif()

if(CMAKE_HOST_SYSTEM_NAME MATCHES "Darwin|Windows")
set(Simde_ERROR_REASON "Ensure that obs-deps is provided as part of CMAKE_PREFIX_PATH.")
elseif(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|FreeBSD")
set(Simde_ERROR_REASON "Ensure simde library is available in local include paths.")
endif()

find_package_handle_standard_args(
Simde
REQUIRED_VARS Simde_INCLUDE_DIR
VERSION_VAR Simde_VERSION REASON_FAILURE_MESSAGE "${Simde_ERROR_REASON}")
mark_as_advanced(Simde_INCLUDE_DIR)
unset(Simde_ERROR_REASON)

if(Simde_FOUND)
if(NOT TARGET Simde::Simde)
add_library(Simde::Simde INTERFACE IMPORTED)
set_target_properties(Simde::Simde PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${Simde_INCLUDE_DIR}")
endif()
endif()

include(FeatureSummary)
set_package_properties(
Simde PROPERTIES
URL "https://simd-everywhere.github.io/blog/"
DESCRIPTION "Implementations of SIMD instruction sets for systems which don't natively support them.")
36 changes: 3 additions & 33 deletions libobs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ find_package(
OPTIONAL_COMPONENTS avcodec)
# cmake-format: on

find_package(Simde REQUIRED)

find_package(ZLIB REQUIRED)

if(ENABLE_UI)
Expand Down Expand Up @@ -141,24 +143,6 @@ target_sources(
util/util_uint128.h
util/util_uint64.h)

target_sources(
libobs
PRIVATE # cmake-format: sortable
util/simde/check.h
util/simde/debug-trap.h
util/simde/hedley.h
util/simde/simde-align.h
util/simde/simde-arch.h
util/simde/simde-common.h
util/simde/simde-constify.h
util/simde/simde-detect-clang.h
util/simde/simde-diagnostic.h
util/simde/simde-features.h
util/simde/simde-math.h
util/simde/x86/mmx.h
util/simde/x86/sse.h
util/simde/x86/sse2.h)

target_sources(
libobs
PRIVATE # cmake-format: sortable
Expand Down Expand Up @@ -259,7 +243,7 @@ target_link_libraries(
FFmpeg::swresample
jansson::jansson
ZLIB::ZLIB
PUBLIC Threads::Threads)
PUBLIC Simde::Simde Threads::Threads)

if(OS_WINDOWS)
include(cmake/os-windows.cmake)
Expand Down Expand Up @@ -354,20 +338,6 @@ set(public_headers
util/profiler.h
util/profiler.hpp
util/serializer.h
util/simde/check.h
util/simde/debug-trap.h
util/simde/hedley.h
util/simde/simde-align.h
util/simde/simde-arch.h
util/simde/simde-common.h
util/simde/simde-constify.h
util/simde/simde-detect-clang.h
util/simde/simde-diagnostic.h
util/simde/simde-features.h
util/simde/simde-math.h
util/simde/x86/mmx.h
util/simde/x86/sse.h
util/simde/x86/sse2.h
util/sse-intrin.h
util/task.h
util/text-lookup.h
Expand Down
20 changes: 2 additions & 18 deletions libobs/cmake/legacy.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ find_package(
COMPONENTS avformat avutil swscale swresample
OPTIONAL_COMPONENTS avcodec)
find_package(ZLIB REQUIRED)
find_package(Simde REQUIRED)

add_library(libobs SHARED)
add_library(OBS::libobs ALIAS libobs)
Expand Down Expand Up @@ -73,23 +74,6 @@ target_sources(
obs-view.c
obs-config.h)

target_sources(
libobs
PRIVATE util/simde/check.h
util/simde/debug-trap.h
util/simde/hedley.h
util/simde/simde-align.h
util/simde/simde-arch.h
util/simde/simde-common.h
util/simde/simde-constify.h
util/simde/simde-detect-clang.h
util/simde/simde-diagnostic.h
util/simde/simde-features.h
util/simde/simde-math.h
util/simde/x86/mmx.h
util/simde/x86/sse2.h
util/simde/x86/sse.h)

target_sources(
libobs
PRIVATE callback/calldata.c
Expand Down Expand Up @@ -257,7 +241,7 @@ target_link_libraries(
OBS::uthash
OBS::libobs-version
ZLIB::ZLIB
PUBLIC Threads::Threads)
PUBLIC Simde::Simde Threads::Threads)

set_target_properties(
libobs
Expand Down
1 change: 1 addition & 0 deletions libobs/cmake/libobsConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ include(CMakeFindDependencyMacro)
if(MSVC)
find_dependency(w32-pthreads REQUIRED)
endif()
find_dependency(Simde REQUIRED)
find_dependency(Threads REQUIRED)

include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")
Expand Down
3 changes: 0 additions & 3 deletions libobs/util/simde/.clang-format

This file was deleted.

Loading
Loading