From c4a5ea47979afd9de5212dcb55ad8233d1b30a6c Mon Sep 17 00:00:00 2001 From: star9029 Date: Sun, 14 Jul 2024 23:56:37 +0800 Subject: [PATCH] fix c++11 --- packages/l/libyuv/patches/1891/cmake.patch | 9 ++++----- packages/l/libyuv/xmake.lua | 8 ++++---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/packages/l/libyuv/patches/1891/cmake.patch b/packages/l/libyuv/patches/1891/cmake.patch index 17bfb744d2e..784e9ee6994 100644 --- a/packages/l/libyuv/patches/1891/cmake.patch +++ b/packages/l/libyuv/patches/1891/cmake.patch @@ -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) @@ -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) @@ -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() @@ -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} ) @@ -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 diff --git a/packages/l/libyuv/xmake.lua b/packages/l/libyuv/xmake.lua index fd4e8a9979c..549bf9b0e78 100644 --- a/packages/l/libyuv/xmake.lua +++ b/packages/l/libyuv/xmake.lua @@ -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"}) @@ -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"))