summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-09-18 15:38:24 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-09-18 18:47:02 +0900
commitc3f03da4944241f46233ce159068f35c5bd5f9b2 (patch)
tree79dc182f22eb10c9de61a6fbdbc8f6d5fac87044 /ext
parent7d354175d7dcabc317030194f503d69a8a7892f5 (diff)
[EXPERIMENTAL] MakeMakefile::CXX for C++
Diffstat (limited to 'ext')
-rw-r--r--ext/-test-/cxxanyargs/extconf.rb25
1 files changed, 5 insertions, 20 deletions
diff --git a/ext/-test-/cxxanyargs/extconf.rb b/ext/-test-/cxxanyargs/extconf.rb
index 0c5344a1e5..78dcb20815 100644
--- a/ext/-test-/cxxanyargs/extconf.rb
+++ b/ext/-test-/cxxanyargs/extconf.rb
@@ -1,21 +1,8 @@
# frozen_string_literal: false
-cfg = RbConfig::CONFIG.merge(
- 'hdrdir' => $hdrdir.quote,
- 'src' => "#{CONFTEST_C}",
- 'arch_hdrdir' => $arch_hdrdir.quote,
- 'top_srcdir' => $top_srcdir.quote,
- 'CC' => RbConfig::CONFIG['CXX'],
- 'CFLAGS' => RbConfig::CONFIG['CXXFLAGS'],
- 'INCFLAGS' => "#$INCFLAGS",
- 'CPPFLAGS' => "#$CPPFLAGS",
- 'ARCH_FLAG' => "#$ARCH_FLAG",
- 'LDFLAGS' => "#$LDFLAGS",
- 'LOCAL_LIBS' => "#$LOCAL_LIBS",
- 'LIBS' => "#$LIBS"
-)
-cxx = RbConfig::expand(TRY_LINK.dup, cfg)
-src = create_tmpsrc(<<~'begin') do |x|
+cxx = MakeMakefile::CXX
+
+ok = cxx.try_compile(<<~'begin', "", lang: 'C++') do |x|
#include "ruby/config.h"
namespace {
@@ -34,8 +21,6 @@ begin
x.sub! %<#include "ruby.h">, ''
end
-begin
- create_makefile("-test-/cxxanyargs") if xsystem(cxx)
-ensure
- log_src src
+if ok
+ create_makefile("-test-/cxxanyargs")
end