Skip to content

Commit

Permalink
mcfgthread: add 1.8.4 version (#5187)
Browse files Browse the repository at this point in the history
* mcfgthread: add 1.8.4 version

* reduce patch size

* fix download version
  • Loading branch information
star-hengxing authored Sep 9, 2024
1 parent 24e3e06 commit 786a467
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 122 deletions.
64 changes: 64 additions & 0 deletions packages/m/mcfgthread/patches/1.8.4/meson.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
diff --git a/meson.build b/meson.build
index 5cf334b..ad9f5cd 100644
--- a/meson.build
+++ b/meson.build
@@ -291,6 +291,8 @@ install_headers(meson.current_build_dir() / 'version.h', subdir: 'mcfgthread')
#===========================================================
# Rules for 'lib/libmcfgthread'
#===========================================================
+if get_option('default_library') == 'shared'
+
mcfgthread_version_o = import('windows').compile_resources(
'mcfgthread/version.rc',
args: [ '-I.', '-c65001' ],
@@ -320,22 +322,25 @@ lib_mcfgthread_dll = shared_library('mcfgthread',
version: '.'.join([ ver.get('abi_major'), ver.get('abi_minor'), '0' ]),
install: true)

-lib_mcfgthread_a = static_library('mcfgthread',
- c_pch: 'mcfgthread/xprecompiled.h',
- c_args: [ '-ffreestanding', '-fasynchronous-unwind-tables' ],
- sources: [ mcfgthread_src_min, mcfgthread_src_ex, ],
- dependencies: [ dep_kernel32, dep_ntdll ],
- install: true)
-
import('pkgconfig').generate(lib_mcfgthread_dll,
name: 'mcfgthread',
url: 'https://github.com/lhmouse/mcfgthread',
description: 'Cornerstone library for C++11 threading on mingw-w64',
libraries: '-lntdll')

+elif get_option('default_library') == 'static'
+
+lib_mcfgthread_a = static_library('mcfgthread',
+ c_pch: 'mcfgthread/xprecompiled.h',
+ c_args: [ '-ffreestanding', '-fasynchronous-unwind-tables' ],
+ sources: [ mcfgthread_src_min, mcfgthread_src_ex, ],
+ dependencies: [ dep_kernel32, dep_ntdll ],
+ install: true)
+endif
#===========================================================
# Rules for tests
#===========================================================
+if get_option('build-test')
foreach src: test_src
test_c_args = []
test_cpp_args = []
@@ -377,3 +382,4 @@ foreach src: test_src

test('..' / src, test_exe)
endforeach
+endif
\ No newline at end of file
diff --git a/meson.options b/meson.options
index d0342f8..b45d572 100644
--- a/meson.options
+++ b/meson.options
@@ -15,3 +15,7 @@
option('enable-debug-checks',
type: 'boolean', value: false,
description: 'enable run-time assertions')
+
+option('build-test',
+ type: 'boolean', value: false,
+ description: 'Build unit test')
118 changes: 0 additions & 118 deletions packages/m/mcfgthread/patches/1.8.alpha-1/meson.patch

This file was deleted.

11 changes: 7 additions & 4 deletions packages/m/mcfgthread/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@ package("mcfgthread")
set_description("Cornerstone of the MOST efficient std::thread on Windows for mingw-w64")
set_license("GPL-3.0")

add_urls("https://github.com/lhmouse/mcfgthread/archive/refs/tags/$(version).tar.gz", {version = function (version) return version:gsub("-alpha", ".alpha-1") end})
add_urls("https://github.com/lhmouse/mcfgthread.git")
add_urls("https://github.com/lhmouse/mcfgthread/archive/refs/tags/$(version).tar.gz", {
version = function (version)
return format("v%d.%d-ga.%d", version:major(), version:minor(), version:patch())
end})

add_versions("1.8-alpha", "4f2b7939f1806b4fb3739d1add63397638e0872c09a1f35c402597aafbc70f32")
add_versions("1.8.4", "d2318ef761927860b7a8963308145065047d8ad2102313b26e6eb2d88d9ef1e3")

add_patches("1.8-alpha", path.join(os.scriptdir(), "patches", "1.8.alpha-1", "meson.patch"), "db0faa7499218357021f3a5d737653bb42a3bf9840b27aae946cc1fe9bf99a50")
add_patches("1.8.4", "patches/1.8.4/meson.patch", "89b98f9152719c44c2a7d8800b63ac621954fd0fe10884b9e90fc3298b76c6c9")

add_configs("debug_checks", {description = "enable run-time assertions", default = false, type = "boolean"})

add_syslinks("ntdll")
add_syslinks("kernel32", "ntdll")

add_deps("meson", "ninja")

Expand Down

0 comments on commit 786a467

Please sign in to comment.