Explicitly link with pthread on Linux

This commit is contained in:
Charles Baker 2023-05-28 20:49:14 +12:00
parent 3d31f45a0f
commit 1f85c9d00a
3 changed files with 24 additions and 1 deletions

View file

@ -1,10 +1,18 @@
for _, cc in toolsets('^cc.*') do
local libraries;
if cc:platform_matches('linux') then
libraries = {
'pthread';
};
end
local cc = cc:inherit {
warning_level = 0;
};
local lalr_examples = cc:Executable '${bin}/lalr_examples' {
libraries = libraries;
'${lib}/lalr_${platform}_${architecture}';
cc:Cxx '${obj}/%1' {
"lalr_examples.cpp",

View file

@ -1,10 +1,17 @@
for _, cc in toolsets('^cc.*') do
local libraries;
if cc:platform_matches('linux') then
libraries = {
'pthread';
};
end
cc:all {
cc:Executable '${bin}/lalr_test' {
libraries = libraries;
'${lib}/lalr_${platform}_${architecture}';
'${lib}/UnitTest++_${platform}_${architecture}';
cc:Cxx '${obj}/%1' {
'main.cpp',
'TestParsers.cpp',

View file

@ -1,7 +1,15 @@
for _, cc in toolsets('^cc.*') do
local libraries;
if cc:platform_matches('linux') then
libraries = {
'pthread';
};
end
cc:all {
cc:Executable '${bin}/lalrc' {
libraries = libraries;
'${lib}/lalr_${platform}_${architecture}';
cc:Cxx '${obj}/%1' {
'dot.cpp';