Skip to content

Commit

Permalink
fix c++11
Browse files Browse the repository at this point in the history
  • Loading branch information
star-hengxing committed Jul 14, 2024
1 parent 1c409f7 commit c4a5ea4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
9 changes: 4 additions & 5 deletions packages/l/libyuv/patches/1891/cmake.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3f521e3..ca0a8f0 100644
index 3f521e3..4d742f3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -73,7 +73,6 @@ if(MSVC)
Expand All @@ -10,7 +10,7 @@ index 3f521e3..ca0a8f0 100644

# Build the set of objects that do not need to be compiled with flags to enable
# particular architecture features.
@@ -120,19 +119,16 @@ if(NOT MSVC)
@@ -120,19 +119,15 @@ if(NOT MSVC)
endif()

# this creates the static library (.a)
Expand All @@ -23,7 +23,6 @@ index 3f521e3..ca0a8f0 100644
-if(WIN32)
- SET_TARGET_PROPERTIES( ${ly_lib_shared} PROPERTIES IMPORT_PREFIX "lib" )
+ADD_LIBRARY( ${ly_lib_static} ${ly_lib_parts})
+target_compile_features(${ly_lib_static} PUBLIC cxx_std_11)
+if (BUILD_SHARED_LIBS)
+ add_definitions("-DLIBYUV_BUILDING_SHARED_LIBRARY")
endif()
Expand All @@ -37,7 +36,7 @@ index 3f521e3..ca0a8f0 100644

# this creates the conversion tool
ADD_EXECUTABLE ( yuvconvert ${ly_base_dir}/util/yuvconvert.cc )
@@ -141,12 +137,22 @@ TARGET_LINK_LIBRARIES ( yuvconvert ${ly_lib_static} )
@@ -141,12 +136,22 @@ TARGET_LINK_LIBRARIES ( yuvconvert ${ly_lib_static} )
# this creates the yuvconstants tool
ADD_EXECUTABLE ( yuvconstants ${ly_base_dir}/util/yuvconstants.c )
TARGET_LINK_LIBRARIES ( yuvconstants ${ly_lib_static} )
Expand Down Expand Up @@ -65,7 +64,7 @@ index 3f521e3..ca0a8f0 100644
endif()

if(UNIT_TEST)
@@ -192,11 +198,8 @@ endif()
@@ -192,11 +197,8 @@ endif()


# install the conversion tool, .so, .a, and all the header files
Expand Down
8 changes: 4 additions & 4 deletions packages/l/libyuv/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ package("libyuv")
alias = "home", version = import("version")
})

package:add("versions", "home:1891", "92eec6118d1c36c4b7dc76397351d86ec0d1da8171c63cd48d5fb130d4384c59")

package:add("versions", "github:1891", "a8dddc6f45d6987cd3c08e00824792f3c72651fde29f475f572ee2292c03761f")

package:add("versions", "home:1891", "92eec6118d1c36c4b7dc76397351d86ec0d1da8171c63cd48d5fb130d4384c59")
end)
end

add_patches("1891", "patches/1891/cmake.patch", "72f16cfdbfe25e091add589fa1b7772c6fd6ee7b159da7ac59ac1b7d6d7f0be1")
add_patches("1891", "patches/1891/cmake.patch", "87086566b2180f65ff3d5ef9db7c59a6e51e2592aeeb787e45305beb4cf9d30d")

add_configs("jpeg", {description = "Build with JPEG.", default = false, type = "boolean"})
add_configs("tools", {description = "Build tools", default = false, type = "boolean"})
Expand All @@ -43,7 +43,7 @@ package("libyuv")
end)

on_install(function (package)
local configs = {}
local configs = {"-DCMAKE_CXX_STANDARD=11"}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
table.insert(configs, "-DLIBYUV_WITH_JPEG=" .. (package:config("jpeg") and "ON" or "OFF"))
Expand Down

0 comments on commit c4a5ea4

Please sign in to comment.