Skip to content

Commit

Permalink
libobs,cmake: Replace vendored SIMD Everywhere by prefix/system install
Browse files Browse the repository at this point in the history
SIMD Everywhere finder needs to be installed alongside libobs CMake
package since its headers depends on it.

macOS AVX intrinsics is included to make sure that AVX defines are
present.
  • Loading branch information
tytan652 committed Aug 28, 2024
1 parent 9344646 commit 2736151
Show file tree
Hide file tree
Showing 24 changed files with 38 additions and 22,923 deletions.
1 change: 1 addition & 0 deletions .github/scripts/utils.zsh/setup_ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ sudo apt-get install -y --no-install-recommends \
libgl1-mesa-dev \
libjansson-dev \
uthash-dev \
libsimde-dev \
libluajit-5.1-dev python3-dev \
libx11-dev libxcb-randr0-dev libxcb-shm0-dev libxcb-xinerama0-dev \
libxcb-composite0-dev libxinerama-dev libxcb1-dev libx11-xcb-dev libxcb-xfixes0-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 @@ -65,6 +65,7 @@
"modules/50-vpl-gpu-rt.json",
"modules/90-asio.json",
"modules/90-nlohmann-json.json",
"modules/90-simde.json",
"modules/90-uthash.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.2",
"commit": "71fd833d9666141edcd1d3c109a80e228303d8d7"
}
]
}
9 changes: 9 additions & 0 deletions cmake/common/helpers_common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,15 @@ function(target_export target)
COMPONENT Development
${exclude_variant}
)

if(target STREQUAL libobs)
install(
FILES "${CMAKE_SOURCE_DIR}/cmake/finders/FindSIMDE.cmake"
DESTINATION "${package_destination}/finders"
COMPONENT Development
${exclude_variant}
)
endif()
endfunction()

# check_uuid: Helper function to check for valid UUID
Expand Down
36 changes: 2 additions & 34 deletions libobs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ legacy_check()

include(cmake/obs-version.cmake)

find_package(SIMDE REQUIRED)
find_package(Threads REQUIRED)

find_package(FFmpeg 6.1 REQUIRED avformat avutil swscale swresample OPTIONAL_COMPONENTS avcodec)
Expand Down Expand Up @@ -132,25 +133,6 @@ target_sources(
util/util_uint64.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/sse.h
util/simde/x86/sse2.h
)

target_sources(
libobs
PRIVATE
Expand Down Expand Up @@ -257,7 +239,7 @@ target_link_libraries(
jansson::jansson
Uthash::Uthash
ZLIB::ZLIB
PUBLIC Threads::Threads
PUBLIC SIMDE::SIMDE Threads::Threads
)

if(OS_WINDOWS)
Expand Down Expand Up @@ -354,20 +336,6 @@ set(
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
3 changes: 3 additions & 0 deletions libobs/cmake/libobsConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

include(CMakeFindDependencyMacro)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/finders")

if(MSVC)
find_dependency(w32-pthreads REQUIRED)
endif()
find_dependency(SIMDE REQUIRED)
find_dependency(Threads REQUIRED)

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

This file was deleted.

40 changes: 0 additions & 40 deletions libobs/util/simde/LICENSE.simde

This file was deleted.

6 changes: 0 additions & 6 deletions libobs/util/simde/README.libobs

This file was deleted.

Loading

0 comments on commit 2736151

Please sign in to comment.