Skip to content

Commit

Permalink
Default to Clang on FreeBSD and OpenBSD (#369)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kojoley authored Apr 20, 2024
1 parent b75a965 commit be168ac
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/build-system.jam
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ local rule should-clean-project ( project )
{
default-toolset = vmsdecc ;
}
else if [ os.name ] = MACOSX
else if [ os.name ] = MACOSX || [ os.name ] = FREEBSD || [ os.name ] = OPENBSD
{
default-toolset = clang ;
}
Expand Down
2 changes: 1 addition & 1 deletion test/BoostBuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def get_toolset():

if sys.platform == "win32":
return "msvc"
if sys.platform == "darwin" or sys.platform.startswith("freebsd"):
if sys.platform == "darwin" or sys.platform.startswith("freebsd") or sys.platform.startswith("openbsd"):
return "clang"

return "gcc"
Expand Down
16 changes: 10 additions & 6 deletions test/default_toolset.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def test_conditions_on_default_toolset():
be used by Boost Build.
"""

t = BoostBuild.Tester("--user-config= --ignore-site-config",
t = BoostBuild.Tester(["--user-config=", "--ignore-site-config"],
pass_toolset=False, use_test_config=False)

toolset_name = "myCustomTestToolset"
Expand Down Expand Up @@ -120,15 +120,15 @@ def test_default_toolset_on_os( os, expected_toolset ):
important internal Boost Build state.
"""

t = BoostBuild.Tester("--user-config= --ignore-site-config",
t = BoostBuild.Tester(["--user-config=", "--ignore-site-config"],
pass_toolset=False, use_test_config=False)

t.write("jamroot.jam", "modules.poke os : .name : %s ;" % os)

# We need to tell the test system to ignore stderr output as attempting to
# load missing toolsets might cause random failures with which we are not
# concerned in this test.
t.run_build_system(stderr=None)
t.run_build_system(status=None, stderr=None)
t.expect_output_lines(configuring_default_toolset_message %
expected_toolset)

Expand All @@ -146,7 +146,7 @@ def test_default_toolset_requirements():
"""Test that default toolset's requirements get applied correctly.
"""

t = BoostBuild.Tester("--user-config= --ignore-site-config",
t = BoostBuild.Tester(["--user-config=", "--ignore-site-config"],
pass_toolset=False, use_test_config=False,
ignore_toolset_requirements=False)

Expand Down Expand Up @@ -210,6 +210,10 @@ def test_default_toolset_requirements():
test_default_toolset_on_os("NT" , "msvc")
test_default_toolset_on_os("LINUX" , "gcc" )
test_default_toolset_on_os("CYGWIN" , "gcc" )
test_default_toolset_on_os("MACOSX" , "clang" )
test_default_toolset_on_os("FREEBSD" , "clang" )
test_default_toolset_on_os("OPENBSD" , "clang" )
test_default_toolset_on_os("SomeOtherOS", "gcc" )
test_default_toolset_requirements()
test_conditions_on_default_toolset()
#test_default_toolset_requirements()
# FIXME: Failure of this test seems to indicate subfeatures matching issue
#test_conditions_on_default_toolset()
3 changes: 1 addition & 2 deletions test/test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,7 @@ def reorder_tests(tests, first_test):
# "debugger-mi",
"default_build",
"default_features",
# This test is known to be broken itself.
# "default_toolset",
"default_toolset",
"dependency_property",
"dependency_test",
"disambiguation",
Expand Down

0 comments on commit be168ac

Please sign in to comment.