From c3f03da4944241f46233ce159068f35c5bd5f9b2 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 18 Sep 2019 15:38:24 +0900 Subject: [EXPERIMENTAL] MakeMakefile::CXX for C++ --- ext/-test-/cxxanyargs/extconf.rb | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) (limited to 'ext/-test-') 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 -- cgit v1.2.3