-
-
Notifications
You must be signed in to change notification settings - Fork 395
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
68eb9ed
commit 14ef2e9
Showing
2 changed files
with
48 additions
and
0 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
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,35 @@ | ||
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/archive/refs/tags/$(version).tar.gz", | ||
"https://github.com/j0r1/JThread.git") | ||
|
||
add_versions("v1.3.3", "5e24779acff268989099a1e135f928ea4f366780d9d7466919037a1414451b95") | ||
add_deps("cmake") | ||
|
||
add_patches("1.3.3", "patches/1.3.3/cmakeList.patch", "4c5162f128f31ebee63805db1dbed0a17fc02b2661958b80468fcffc394d7f4e") | ||
|
||
add_includedirs("include", "include/jthread") | ||
on_install(function (package) | ||
|
||
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") | ||
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{ | ||
}; | ||
]]}, {configs = {languages = "c++11"}, includes = "jthread.h"})) | ||
end) |