diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2022-05-05 10:56:53 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2022-05-05 10:56:53 +0200 |
commit | ac127b132a7a5f356e3a9b7bf7c3b74f9469bf6e (patch) | |
tree | 3a4353ecb6ef721e899b88922e0f4e94230b41f4 /libbuild2/cc/link-rule.cxx | |
parent | 9525ffdb54cd1dbe55a2d8d2ed3d351d8793a8e3 (diff) |
Recognize -pthread as king of -l in *.libs
Diffstat (limited to 'libbuild2/cc/link-rule.cxx')
-rw-r--r-- | libbuild2/cc/link-rule.cxx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/libbuild2/cc/link-rule.cxx b/libbuild2/cc/link-rule.cxx index f8414c9..0c7c0c2 100644 --- a/libbuild2/cc/link-rule.cxx +++ b/libbuild2/cc/link-rule.cxx @@ -156,7 +156,7 @@ namespace build2 { if (s[0] == '-') { - // -l<name>, -l <name> + // -l<name>, -l <name> (Note: not -pthread, which is system) // if (s[1] == 'l') { @@ -1288,7 +1288,7 @@ namespace build2 } // Another thing we must check is for the presence of any simple - // libraries (-lpthread, shell32.lib, etc) in *.export.libs. See + // libraries (-lm, shell32.lib, etc) in *.export.libs. See // process_libraries() for details. // if (rec_binless) @@ -1522,6 +1522,16 @@ namespace build2 // represent it as an exe{} member to make sure it gets installed // next to the main .js file. // + // @@ Note that our recommendation is to pass -pthread in *.libs + // but checking that is not straightforward (it could come from + // one of the libraries that we are linking). We could have called + // append_libraries() (similar to $x.lib_libs()) and then looked + // there. But this is quite heavy handed and it's not clear this + // is worth the trouble since the -pthread support in Emscripten + // is quite high-touch (i.e., it's not like we can write a library + // that starts some threads and then run its test as on any other + // POSIX platform). + // if (find_option ("-pthread", cmode) || find_option ("-pthread", t, c_loptions) || find_option ("-pthread", t, x_loptions)) |