Compare commits
No commits in common. "8f0f320a07548e1edae96a82945bb6bb22e29221" and "21f8e2435eb1f16638dbcea7de27716af8b958b7" have entirely different histories.
8f0f320a07
...
21f8e2435e
@ -1,10 +1,3 @@
|
|||||||
## v3.0.2
|
|
||||||
|
|
||||||
### Fixes
|
|
||||||
|
|
||||||
- #159 - Compiler check configure methods should respect :use flag
|
|
||||||
- #160 - Configure parameters should not be stored as unscoped construction variables
|
|
||||||
|
|
||||||
## v3.0.1
|
## v3.0.1
|
||||||
|
|
||||||
### Fixes
|
### Fixes
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
configure do
|
|
||||||
check_c_compiler "clang", use: "clang"
|
|
||||||
check_c_compiler
|
|
||||||
end
|
|
||||||
|
|
||||||
env "t1" do |env|
|
|
||||||
env.Program("test_gcc.exe", "simple.c")
|
|
||||||
end
|
|
||||||
|
|
||||||
env "t2", use: "clang" do |env|
|
|
||||||
env.Program("test_clang.exe", "simple.c")
|
|
||||||
end
|
|
@ -1,12 +0,0 @@
|
|||||||
configure do
|
|
||||||
check_cxx_compiler "clang++", use: "clang"
|
|
||||||
check_cxx_compiler
|
|
||||||
end
|
|
||||||
|
|
||||||
env "t1" do |env|
|
|
||||||
env.Program("test_gcc.exe", "simple.cc")
|
|
||||||
end
|
|
||||||
|
|
||||||
env "t2", use: "clang" do |env|
|
|
||||||
env.Program("test_clang.exe", "simple.cc")
|
|
||||||
end
|
|
@ -1,12 +0,0 @@
|
|||||||
configure do
|
|
||||||
check_d_compiler "ldc2", use: "ldc2"
|
|
||||||
check_d_compiler
|
|
||||||
end
|
|
||||||
|
|
||||||
env "t1" do |env|
|
|
||||||
env.Program("test_gcc.exe", "simple.d")
|
|
||||||
end
|
|
||||||
|
|
||||||
env "t2", use: "ldc2" do |env|
|
|
||||||
env.Program("test_ldc2.exe", "simple.d")
|
|
||||||
end
|
|
@ -1,6 +0,0 @@
|
|||||||
#include <iostream>
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
|
||||||
{
|
|
||||||
std::cout << "Hi" << std::endl;
|
|
||||||
}
|
|
@ -1,7 +0,0 @@
|
|||||||
import std.stdio;
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
writeln("Hello");
|
|
||||||
return 0;
|
|
||||||
}
|
|
@ -23,11 +23,14 @@ module Rscons
|
|||||||
$stdout.puts "Configuring project..."
|
$stdout.puts "Configuring project..."
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
vars = {}
|
||||||
Task["configure"].params.each do |name, param|
|
Task["configure"].params.each do |name, param|
|
||||||
unless Rscons.application.silent_configure
|
unless Rscons.application.silent_configure
|
||||||
Ansi.write($stdout, "Setting #{name}... ", :green, param.value, :reset, "\n")
|
Ansi.write($stdout, "Setting #{name}... ", :green, param.value, :reset, "\n")
|
||||||
end
|
end
|
||||||
|
vars[name] = param.value
|
||||||
end
|
end
|
||||||
|
store_merge(vars)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Close the log file handle.
|
# Close the log file handle.
|
||||||
@ -62,7 +65,7 @@ module Rscons
|
|||||||
ccc = %w[gcc clang]
|
ccc = %w[gcc clang]
|
||||||
end
|
end
|
||||||
cc = ccc.find do |cc|
|
cc = ccc.find do |cc|
|
||||||
test_c_compiler(cc, options)
|
test_c_compiler(cc)
|
||||||
end
|
end
|
||||||
complete(cc ? 0 : 1, options.merge(success_message: cc))
|
complete(cc ? 0 : 1, options.merge(success_message: cc))
|
||||||
end
|
end
|
||||||
@ -84,7 +87,7 @@ module Rscons
|
|||||||
ccc = %w[g++ clang++]
|
ccc = %w[g++ clang++]
|
||||||
end
|
end
|
||||||
cc = ccc.find do |cc|
|
cc = ccc.find do |cc|
|
||||||
test_cxx_compiler(cc, options)
|
test_cxx_compiler(cc)
|
||||||
end
|
end
|
||||||
complete(cc ? 0 : 1, options.merge(success_message: cc))
|
complete(cc ? 0 : 1, options.merge(success_message: cc))
|
||||||
end
|
end
|
||||||
@ -106,7 +109,7 @@ module Rscons
|
|||||||
cdc = %w[gdc ldc2]
|
cdc = %w[gdc ldc2]
|
||||||
end
|
end
|
||||||
dc = cdc.find do |dc|
|
dc = cdc.find do |dc|
|
||||||
test_d_compiler(dc, options)
|
test_d_compiler(dc)
|
||||||
end
|
end
|
||||||
complete(dc ? 0 : 1, options.merge(success_message: dc))
|
complete(dc ? 0 : 1, options.merge(success_message: dc))
|
||||||
end
|
end
|
||||||
@ -412,7 +415,7 @@ module Rscons
|
|||||||
#
|
#
|
||||||
# @return [Boolean]
|
# @return [Boolean]
|
||||||
# Whether the C compiler tested successfully.
|
# Whether the C compiler tested successfully.
|
||||||
def test_c_compiler(cc, options)
|
def test_c_compiler(cc)
|
||||||
File.open("#{@work_dir}/cfgtest.c", "wb") do |fh|
|
File.open("#{@work_dir}/cfgtest.c", "wb") do |fh|
|
||||||
fh.puts <<-EOF
|
fh.puts <<-EOF
|
||||||
int fun(int val) {
|
int fun(int val) {
|
||||||
@ -424,7 +427,7 @@ module Rscons
|
|||||||
merge = {"CC" => cc}
|
merge = {"CC" => cc}
|
||||||
_, _, status = log_and_test_command(command)
|
_, _, status = log_and_test_command(command)
|
||||||
if status == 0
|
if status == 0
|
||||||
store_merge(merge, options)
|
store_merge(merge)
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -436,7 +439,7 @@ module Rscons
|
|||||||
#
|
#
|
||||||
# @return [Boolean]
|
# @return [Boolean]
|
||||||
# Whether the C++ compiler tested successfully.
|
# Whether the C++ compiler tested successfully.
|
||||||
def test_cxx_compiler(cc, options)
|
def test_cxx_compiler(cc)
|
||||||
File.open("#{@work_dir}/cfgtest.cxx", "wb") do |fh|
|
File.open("#{@work_dir}/cfgtest.cxx", "wb") do |fh|
|
||||||
fh.puts <<-EOF
|
fh.puts <<-EOF
|
||||||
template<typename T>
|
template<typename T>
|
||||||
@ -449,7 +452,7 @@ module Rscons
|
|||||||
merge = {"CXX" => cc}
|
merge = {"CXX" => cc}
|
||||||
_, _, status = log_and_test_command(command)
|
_, _, status = log_and_test_command(command)
|
||||||
if status == 0
|
if status == 0
|
||||||
store_merge(merge, options)
|
store_merge(merge)
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -461,7 +464,7 @@ module Rscons
|
|||||||
#
|
#
|
||||||
# @return [Boolean]
|
# @return [Boolean]
|
||||||
# Whether the D compiler tested successfully.
|
# Whether the D compiler tested successfully.
|
||||||
def test_d_compiler(dc, options)
|
def test_d_compiler(dc)
|
||||||
File.open("#{@work_dir}/cfgtest.d", "wb") do |fh|
|
File.open("#{@work_dir}/cfgtest.d", "wb") do |fh|
|
||||||
fh.puts <<-EOF
|
fh.puts <<-EOF
|
||||||
import core.math;
|
import core.math;
|
||||||
@ -490,7 +493,7 @@ module Rscons
|
|||||||
end
|
end
|
||||||
_, _, status = log_and_test_command(command)
|
_, _, status = log_and_test_command(command)
|
||||||
if status == 0
|
if status == 0
|
||||||
store_merge(merge, options)
|
store_merge(merge)
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
module Rscons
|
module Rscons
|
||||||
# Project version.
|
# Project version.
|
||||||
VERSION = "3.0.2"
|
VERSION = "3.0.1"
|
||||||
end
|
end
|
||||||
|
@ -1940,17 +1940,6 @@ EOF
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it "respects use flag" do
|
|
||||||
test_dir "configure"
|
|
||||||
result = run_rscons(args: %w[-f check_c_compiler_use.rb -v])
|
|
||||||
expect(result.stderr).to eq ""
|
|
||||||
expect(result.status).to eq 0
|
|
||||||
expect(result.stdout).to match %r{\bgcc .*/t1/}
|
|
||||||
expect(result.stdout).to_not match %r{\bclang .*/t1/}
|
|
||||||
expect(result.stdout).to match %r{\bclang .*/t2/}
|
|
||||||
expect(result.stdout).to_not match %r{\bgcc .*/t2/}
|
|
||||||
end
|
|
||||||
|
|
||||||
it "successfully tests a compiler with an unknown name" do
|
it "successfully tests a compiler with an unknown name" do
|
||||||
test_dir "configure"
|
test_dir "configure"
|
||||||
create_exe "mycompiler", %[exec gcc "$@"]
|
create_exe "mycompiler", %[exec gcc "$@"]
|
||||||
@ -1994,17 +1983,6 @@ EOF
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it "respects use flag" do
|
|
||||||
test_dir "configure"
|
|
||||||
result = run_rscons(args: %w[-f check_cxx_compiler_use.rb -v])
|
|
||||||
expect(result.stderr).to eq ""
|
|
||||||
expect(result.status).to eq 0
|
|
||||||
expect(result.stdout).to match %r{\bg\+\+ .*/t1/}
|
|
||||||
expect(result.stdout).to_not match %r{\bclang\+\+ .*/t1/}
|
|
||||||
expect(result.stdout).to match %r{\bclang\+\+ .*/t2/}
|
|
||||||
expect(result.stdout).to_not match %r{\bg\+\+ .*/t2/}
|
|
||||||
end
|
|
||||||
|
|
||||||
it "successfully tests a compiler with an unknown name" do
|
it "successfully tests a compiler with an unknown name" do
|
||||||
test_dir "configure"
|
test_dir "configure"
|
||||||
create_exe "mycompiler", %[exec clang++ "$@"]
|
create_exe "mycompiler", %[exec clang++ "$@"]
|
||||||
@ -2050,17 +2028,6 @@ EOF
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it "respects use flag" do
|
|
||||||
test_dir "configure"
|
|
||||||
result = run_rscons(args: %w[-f check_d_compiler_use.rb -v])
|
|
||||||
expect(result.stderr).to eq ""
|
|
||||||
expect(result.status).to eq 0
|
|
||||||
expect(result.stdout).to match %r{\bgdc .*/t1/}
|
|
||||||
expect(result.stdout).to_not match %r{\bldc2 .*/t1/}
|
|
||||||
expect(result.stdout).to match %r{\bldc2 .*/t2/}
|
|
||||||
expect(result.stdout).to_not match %r{\bgdc .*/t2/}
|
|
||||||
end
|
|
||||||
|
|
||||||
unless RUBY_PLATFORM =~ /mingw|msys/
|
unless RUBY_PLATFORM =~ /mingw|msys/
|
||||||
it "successfully tests a compiler with an unknown name that uses gdc-compatible options" do
|
it "successfully tests a compiler with an unknown name that uses gdc-compatible options" do
|
||||||
test_dir "configure"
|
test_dir "configure"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user