提交 15631f1c 编写于 作者: M mvandervoord

More tweaking to make it happy on both windows and *nix

上级 8d044e60
...@@ -6,10 +6,13 @@ ...@@ -6,10 +6,13 @@
require 'yaml' require 'yaml'
require 'fileutils' require 'fileutils'
require 'rbconfig'
require_relative '../../auto/unity_test_summary' require_relative '../../auto/unity_test_summary'
require_relative '../../auto/generate_test_runner' require_relative '../../auto/generate_test_runner'
require_relative '../../auto/colour_reporter' require_relative '../../auto/colour_reporter'
$is_windows = (RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/)
C_EXTENSION = '.c'.freeze C_EXTENSION = '.c'.freeze
def load_configuration(config_file) def load_configuration(config_file)
...@@ -52,7 +55,12 @@ def build_compiler_fields ...@@ -52,7 +55,12 @@ def build_compiler_fields
defines = if $cfg['compiler']['defines']['items'].nil? defines = if $cfg['compiler']['defines']['items'].nil?
'' ''
else else
squash($cfg['compiler']['defines']['prefix'], $cfg['compiler']['defines']['items'] + ['UNITY_OUTPUT_CHAR=UnityOutputCharSpy_OutputChar'] + ['UNITY_OUTPUT_CHAR_HEADER_DECLARATION=UnityOutputCharSpy_OutputChar(int)']) if $is_windows
decl = 'UNITY_OUTPUT_CHAR_HEADER_DECLARATION=UnityOutputCharSpy_OutputChar(int)'
else
decl = 'UNITY_OUTPUT_CHAR_HEADER_DECLARATION=UnityOutputCharSpy_OutputChar\(int\)'
end
squash($cfg['compiler']['defines']['prefix'], $cfg['compiler']['defines']['items'] + ['UNITY_OUTPUT_CHAR=UnityOutputCharSpy_OutputChar'] + [decl])
end end
options = squash('', $cfg['compiler']['options']) options = squash('', $cfg['compiler']['options'])
includes = squash($cfg['compiler']['includes']['prefix'], $cfg['compiler']['includes']['items']) includes = squash($cfg['compiler']['includes']['prefix'], $cfg['compiler']['includes']['items'])
......
...@@ -6,7 +6,11 @@ endif ...@@ -6,7 +6,11 @@ endif
CFLAGS += -std=c99 -pedantic -Wall -Wextra -Werror CFLAGS += -std=c99 -pedantic -Wall -Wextra -Werror
CFLAGS += $(DEBUG) CFLAGS += $(DEBUG)
DEFINES = -D UNITY_OUTPUT_CHAR=UnityOutputCharSpy_OutputChar DEFINES = -D UNITY_OUTPUT_CHAR=UnityOutputCharSpy_OutputChar
DEFINES += -D UNITY_OUTPUT_CHAR_HEADER_DECLARATION=UnityOutputCharSpy_OutputChar(int) ifeq ($(OS),Windows_NT)
DEFINES += -D UNITY_OUTPUT_CHAR_HEADER_DECLARATION=UnityOutputCharSpy_OutputChar(int)
else
DEFINES += -D UNITY_OUTPUT_CHAR_HEADER_DECLARATION=UnityOutputCharSpy_OutputChar\(int\)
endif
SRC = ../src/unity_fixture.c \ SRC = ../src/unity_fixture.c \
../../../src/unity.c \ ../../../src/unity.c \
unity_fixture_Test.c \ unity_fixture_Test.c \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册