Unverified Commit 38b767e5 by Manuel Binna Committed by GitHub

Bazel qnx (#1192)

* Don't link pthread on QNX On QNX, pthread is part of libc [1]. There's no separate pthread library to link. [1] https://www.qnx.com/developers/docs/7.1/index.html#com.qnx.doc.neutrino.lib_ref/topic/p/pthread_create.html * Explain that QNX doesn't have pthread lib
parent d6778aeb
...@@ -3,7 +3,17 @@ load("@rules_cc//cc:defs.bzl", "cc_library") ...@@ -3,7 +3,17 @@ load("@rules_cc//cc:defs.bzl", "cc_library")
licenses(["notice"]) licenses(["notice"])
config_setting( config_setting(
name = "qnx",
constraint_values = ["@platforms//os:qnx"],
values = {
"cpu": "x64_qnx",
},
visibility = [":__subpackages__"],
)
config_setting(
name = "windows", name = "windows",
constraint_values = ["@platforms//os:windows"],
values = { values = {
"cpu": "x64_windows", "cpu": "x64_windows",
}, },
......
...@@ -227,6 +227,11 @@ can link to pthread by adding `-pthread` to your linker command. Note, you can ...@@ -227,6 +227,11 @@ can link to pthread by adding `-pthread` to your linker command. Note, you can
also use `-lpthread`, but there are potential issues with ordering of command also use `-lpthread`, but there are potential issues with ordering of command
line parameters if you use that. line parameters if you use that.
On QNX, the pthread library is part of libc and usually included automatically
(see
[`pthread_create()`](https://www.qnx.com/developers/docs/7.1/index.html#com.qnx.doc.neutrino.lib_ref/topic/p/pthread_create.html)).
There's no separate pthread library to link.
### Building with Visual Studio 2015 or 2017 ### Building with Visual Studio 2015 or 2017
The `shlwapi` library (`-lshlwapi`) is required to support a call to `CPUInfo` which reads the registry. Either add `shlwapi.lib` under `[ Configuration Properties > Linker > Input ]`, or use the following: The `shlwapi` library (`-lshlwapi`) is required to support a call to `CPUInfo` which reads the registry. Either add `shlwapi.lib` under `[ Configuration Properties > Linker > Input ]`, or use the following:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment