generated from obsproject/obs-plugintemplate
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from obs-ai/roy.prep_to_ship
Prep to ship
- Loading branch information
Showing
22 changed files
with
352 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ | |
!CMakePresets.json | ||
!LICENSE | ||
!README.md | ||
!patch_libobs.diff | ||
|
||
# Exclude lock files | ||
*.lock.json | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,50 @@ | ||
# build sentencepiece from "https://github.com/google/sentencepiece.git" | ||
|
||
include(ExternalProject) | ||
|
||
set(SP_URL | ||
"https://github.com/google/sentencepiece.git" | ||
CACHE STRING "URL of sentencepiece repository") | ||
|
||
ExternalProject_Add( | ||
sentencepiece_build | ||
DOWNLOAD_EXTRACT_TIMESTAMP true | ||
GIT_REPOSITORY ${SP_URL} | ||
GIT_TAG v0.1.99 | ||
BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --config ${CMAKE_BUILD_TYPE} | ||
CMAKE_GENERATOR ${CMAKE_GENERATOR} | ||
INSTALL_COMMAND ${CMAKE_COMMAND} --install <BINARY_DIR> --config ${CMAKE_BUILD_TYPE} | ||
CMAKE_ARGS -DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM} -DCMAKE_OSX_DEPLOYMENT_TARGET=10.13 | ||
-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES_} -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> | ||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}) | ||
ExternalProject_Get_Property(sentencepiece_build INSTALL_DIR) | ||
|
||
add_library(libsentencepiece SHARED IMPORTED GLOBAL) | ||
set_target_properties( | ||
libsentencepiece | ||
PROPERTIES IMPORTED_LOCATION | ||
${INSTALL_DIR}/bin/${CMAKE_SHARED_LIBRARY_PREFIX}sentencepiece${CMAKE_SHARED_LIBRARY_SUFFIX}) | ||
set_target_properties( | ||
libsentencepiece | ||
PROPERTIES IMPORTED_IMPLIB | ||
${INSTALL_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}sentencepiece${CMAKE_STATIC_LIBRARY_SUFFIX}) | ||
|
||
add_library(sentencepiece INTERFACE) | ||
add_dependencies(sentencepiece sentencepiece_build) | ||
target_link_libraries(sentencepiece INTERFACE libsentencepiece) | ||
set_target_properties(libsentencepiece PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${INSTALL_DIR}/include) | ||
if(APPLE) | ||
|
||
include(FetchContent) | ||
|
||
FetchContent_Declare( | ||
sentencepiece_fetch | ||
URL https://github.com/obs-ai/obs-ai-ctranslate2-dep/releases/download/1.0.0/libsentencepiece-macos-Release-1.0.0.tar.gz | ||
URL_HASH SHA256=67f58a8e97c14db1bc69becd507ffe69326948f371bf874fe919157d7d65aff4) | ||
FetchContent_MakeAvailable(sentencepiece_fetch) | ||
add_library(sentencepiece INTERFACE) | ||
target_link_libraries(sentencepiece INTERFACE ${sentencepiece_fetch_SOURCE_DIR}/lib/libsentencepiece.a) | ||
set_target_properties(sentencepiece PROPERTIES INTERFACE_INCLUDE_DIRECTORIES | ||
${sentencepiece_fetch_SOURCE_DIR}/include) | ||
|
||
else() | ||
|
||
set(SP_URL | ||
"https://github.com/google/sentencepiece.git" | ||
CACHE STRING "URL of sentencepiece repository") | ||
|
||
set(SP_CMAKE_OPTIONS -DSPM_ENABLE_SHARED=OFF) | ||
set(SENTENCEPIECE_INSTALL_LIB_LOCATION lib/${CMAKE_STATIC_LIBRARY_PREFIX}sentencepiece${CMAKE_STATIC_LIBRARY_SUFFIX}) | ||
|
||
include(ExternalProject) | ||
|
||
ExternalProject_Add( | ||
sentencepiece_build | ||
GIT_REPOSITORY ${SP_URL} | ||
GIT_TAG v0.1.99 | ||
BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --config ${CMAKE_BUILD_TYPE} | ||
CMAKE_GENERATOR ${CMAKE_GENERATOR} | ||
INSTALL_COMMAND ${CMAKE_COMMAND} --install <BINARY_DIR> --config ${CMAKE_BUILD_TYPE} | ||
BUILD_BYPRODUCTS <INSTALL_DIR>/${SENTENCEPIECE_INSTALL_LIB_LOCATION} | ||
CMAKE_ARGS -DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM} -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> | ||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} ${SP_CMAKE_OPTIONS}) | ||
ExternalProject_Get_Property(sentencepiece_build INSTALL_DIR) | ||
|
||
add_library(libsentencepiece STATIC IMPORTED GLOBAL) | ||
add_dependencies(libsentencepiece sentencepiece_build) | ||
set_target_properties(libsentencepiece PROPERTIES IMPORTED_LOCATION | ||
${INSTALL_DIR}/${SENTENCEPIECE_INSTALL_LIB_LOCATION}) | ||
|
||
add_library(sentencepiece INTERFACE) | ||
add_dependencies(sentencepiece libsentencepiece) | ||
target_link_libraries(sentencepiece INTERFACE libsentencepiece) | ||
target_include_directories(sentencepiece INTERFACE ${INSTALL_DIR}/include) | ||
|
||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff --git a/libobs/CMakeLists.txt b/libobs/CMakeLists.txt | ||
index d2e2671..d7797c6 100644 | ||
--- a/libobs/CMakeLists.txt | ||
+++ b/libobs/CMakeLists.txt | ||
@@ -287,6 +287,7 @@ set(public_headers | ||
util/base.h | ||
util/bmem.h | ||
util/c99defs.h | ||
+ util/config-file.h | ||
util/darray.h | ||
util/profiler.h | ||
util/sse-intrin.h |
Oops, something went wrong.