-
-
Notifications
You must be signed in to change notification settings - Fork 395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add jthread repo #5236
Merged
Merged
add jthread repo #5236
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
14ef2e9
add jthread repo
hahahahbenny 424aeb7
change the version and patch name
hahahahbenny 8ab9284
change pathc and test way
hahahahbenny 445f7e0
change patch and test way
hahahahbenny cccb4fc
Revert "change pathc and test way"
hahahahbenny b6ad973
change patch and test way
hahahahbenny df80c7a
change patch for share or static build
hahahahbenny a76682f
change patch
hahahahbenny File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt | ||
index 517e13f..3224c46 100644 | ||
--- a/src/CMakeLists.txt | ||
+++ b/src/CMakeLists.txt | ||
@@ -35,7 +35,7 @@ else () | ||
set(JTHREAD_COMPILE_STATIC ON CACHE BOOL "Flag indicating if a static library should be built, or a dynamic one") | ||
endif () | ||
|
||
-if (NOT MSVC OR JTHREAD_COMPILE_STATIC) | ||
+if (NOT MSVC AND JTHREAD_COMPILE_STATIC) | ||
set(JTHREAD_INSTALLTARGETS jthread-static) | ||
add_library(jthread-static STATIC ${SOURCES} ${HEADERS}) | ||
set_target_properties(jthread-static PROPERTIES OUTPUT_NAME jthread) |
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,36 @@ | ||
package("jthread") | ||
set_homepage("https://github.com/j0r1/JThread") | ||
set_description("The JThread package provides some classes to make use of threads easy on different platforms") | ||
set_license("MIT") | ||
|
||
add_urls("https://github.com/j0r1/JThread.git") | ||
|
||
add_versions("2023.08.18", "719413043807b77448df3ba1c749798fb72ee459") | ||
add_deps("cmake") | ||
|
||
add_patches("1.3.3", "patches/1.3.3/cmakelist.patch", "4c5162f128f31ebee63805db1dbed0a17fc02b2661958b80468fcffc394d7f4e") | ||
|
||
add_includedirs("include", "include/jthread") | ||
|
||
on_install("windows", "linux", "macosx", function(package) | ||
|
||
star-hengxing marked this conversation as resolved.
Show resolved
Hide resolved
|
||
local configs = {} | ||
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) | ||
if package:config("shared") then | ||
table.insert(configs, "-DJTHREAD_COMPILE_STATIC=OFF") | ||
table.insert(configs, "-DJTHREAD_COMPILE_STATIC_ONLY=OFF") | ||
else | ||
table.insert(configs, "-DJTHREAD_COMPILE_STATIC_ONLY=ON") | ||
table.insert(configs, "-DJTHREAD_COMPILE_STATIC=ON") | ||
end | ||
|
||
import("package.tools.cmake").install(package, configs) | ||
end) | ||
|
||
on_test(function (package) | ||
assert(package:check_cxxsnippets({test = [[ | ||
using namespace jthread; | ||
class TestThread : public JThread{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 纯类型定义,没任何实例化对象,测不到 links 吧 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 已修改 |
||
}; | ||
]]}, {configs = {languages = "c++11"}, includes = "jthread.h"})) | ||
end) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
补丁可以去掉了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果去掉补丁会在shared=true时,仍然会生成静态库
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改补丁