Skip to content

Commit 8c70c04

Browse files
committed
Accept c++ as g++
1 parent b256259 commit 8c70c04

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

lib/extpp/compiler.rb

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,27 @@ def check_version
6060
std = nil
6161

6262
case `#{RbConfig.expand("$(CXX) --version")}`
63-
when /g\+\+.+ (\d+\.\d+)\.\d/
63+
when /[cg]\+\+.+ (\d+\.\d+)\.\d/
64+
# Examples:
65+
# "g++ --version" on Debian:
66+
#
67+
# g++ (Debian 15.2.0-12) 15.2.0
68+
# ...
69+
#
70+
# "c++ --version" on Debian:
71+
#
72+
# c++ (Debian 15.2.0-12) 15.2.0
73+
# ...
74+
#
75+
# "x86_64-conda-linux-gnu-g++ --version" on conda
76+
#
77+
# x86_64-conda-linux-gnu-g++ (conda-forge gcc 14.3.0-18) 14.3.0
78+
# ...
79+
#
80+
# "x86_64-conda-linux-gnu-c++ --version" on conda
81+
#
82+
# x86_64-conda-linux-gnu-c++ (conda-forge gcc 14.3.0-18) 14.3.0
83+
# ...
6484
version = Float($1)
6585
if version < 5.1
6686
std = "gnu++11"

0 commit comments

Comments
 (0)