Skip to content

Commit

Permalink
WASM Pthread support (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
fpelliccioni authored Nov 10, 2023
1 parent 2b0dc8c commit 24e197a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,12 @@ target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC ${Boost_INCLUDE_DIR})
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
target_link_libraries(${PROJECT_NAME} PUBLIC Boost::program_options)
target_link_libraries(${PROJECT_NAME} PUBLIC Boost::thread)
else()
target_compile_options(${PROJECT_NAME} PUBLIC "-pthread")
target_link_options(${PROJECT_NAME} PUBLIC "-pthread")
set_target_properties(${PROJECT_NAME} PROPERTIES
COMPILE_FLAGS "-pthread"
LINK_FLAGS "-pthread")
endif()

target_link_libraries(${PROJECT_NAME} PUBLIC fmt::fmt-header-only)
Expand Down
10 changes: 4 additions & 6 deletions conan.lock
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
{
"version": "0.5",
"requires": [
"zlib/1.2.13#e377bee636333ae348d51ca90874e353%1682597484.674",
"spdlog/1.12.0#0e390a2f5c3e96671d0857bc734e4731%1693277101.493",
"secp256k1/0.18.0#c2e7e05855c71cb8f4e350a7aa10bfa9%1698921631.178",
"libbacktrace/cci.20210118#ec1aa63bbc10145c6a299e68e711670c%1676205469.545",
"gmp/6.3.0#df20ffb6d21c34d67704305bcd1dea9e%1698225617.026",
"fmt/10.1.1#cd63809a79574a2f9eb73ca35f16a243%1693230699.985",
"expected-lite/0.6.3#262026767cf9d5ab1fdccb25c9bdbac2%1692807329.641",
"ctre/3.8#b20dc94ec71df126170a4be9ca5e9486%1691461344.415",
"bzip2/1.0.8#411fc05e80d47a89045edc1ee6f23c1d%1678293522.814",
"boost/1.83.0#f0c3932db7f65b606ed78357ecbdcbef%1692286008.562"
"boost/1.83.0#7825569cd0622461dec7bc87dfdf47ae%1699112266.217"
],
"build_requires": [
"m4/1.4.19#c1c4b1ee919e34630bb9b50046253d3c%1676610086.39",
"b2/4.9.6#2e02945ad41739b8051247d14fe8297d%1679927934.674"
"nodejs/16.3.0#fbb644235845086644bebd53e452595b%1693183693.992",
"m4/1.4.19#adbdd7fb7db33e609425c797196baccb%1697449900.379",
"emsdk/3.1.44#a6d941a26a1c416d25e3505805703a58%1691145317.971"
],
"python_requires": []
}
3 changes: 2 additions & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ def package_info(self):

#TODO(fernando): add the rest of the conditional dependencies

if self.settings.os == "Linux" or self.settings.os == "FreeBSD":

if self.settings.os == "Linux" or self.settings.os == "FreeBSD" or self.settings.os == "Emscripten":
self.cpp_info.system_libs.append("pthread")

if self.settings.os == "Linux" and self.settings.compiler == "gcc" and float(str(self.settings.compiler.version)) <= 8:
Expand Down

0 comments on commit 24e197a

Please sign in to comment.