Skip to content

Instantly share code, notes, and snippets.

View iwadon's full-sized avatar

IWATSUKI Hiroyuki iwadon

View GitHub Profile
>gem install nokogiri
Fetching: nokogiri-1.4.4.1-x86-mswin32.gem (100%)
Successfully installed nokogiri-1.4.4.1-x86-mswin32
1 gem installed
Installing ri documentation for nokogiri-1.4.4.1-x86-mswin32...
Installing RDoc documentation for nokogiri-1.4.4.1-x86-mswin32...
>ruby -v -rnokogiri -e 0
ruby 1.9.2p180 (2011-02-18) [i386-mswin32_100]
D:/private/tools/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': 126: 指定されたモジュールが見つかりません。 - D:/private/tools/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/nokogiri-1.4.4.1-x86-mswin32/lib/nokogiri/1.9/nokogiri.so (LoadError)
<!DOCTYPE html>
<html>
<head>
<style>
html {
margin: 0;
padding: 0;
}
body {
margin: 0;
diff --git a/src/graph_test.cc b/src/graph_test.cc
index ba41440..ef9fee2 100644
--- a/src/graph_test.cc
+++ b/src/graph_test.cc
@@ -79,3 +79,28 @@ TEST_F(GraphTest, ExplicitImplicit) {
// the output to be dirty).
EXPECT_TRUE(GetNode("out.o")->dirty_);
}
+
+TEST_F(GraphTest, PathWithCurrentDirectory) {
@iwadon
iwadon / gist:924738
Created April 18, 2011 02:59
diff of src/graph_test.cc
diff --git a/src/graph_test.cc b/src/graph_test.cc
index ba41440..56e8ab5 100644
--- a/src/graph_test.cc
+++ b/src/graph_test.cc
@@ -79,3 +79,21 @@ TEST_F(GraphTest, ExplicitImplicit) {
// the output to be dirty).
EXPECT_TRUE(GetNode("out.o")->dirty_);
}
+
+TEST_F(GraphTest, PathWithCurrentDirectory) {
@iwadon
iwadon / gist:923836
Created April 17, 2011 07:54
Canonicalize target filename when loading depfiles
diff --git a/src/graph.cc b/src/graph.cc
index a4317ba..bbfb8df 100644
--- a/src/graph.cc
+++ b/src/graph.cc
@@ -148,8 +148,11 @@ bool Edge::LoadDepFile(State* state, DiskInterface* disk_interface,
*err = "expected only one output";
return false;
}
- if (outputs_[0]->file_->path_ != makefile.out_) {
- *err = "expected makefile to mention '" + outputs_[0]->file_->path_ + "', "
srcdir = .
builddir = .
cc = gcc
cflags = -Wall -Wextra -O2 -g
cppflags =
rule cc
depfile = $out.d
command = $cc -MMD -MF $out.d $cflags $cppflags-c $in -o $out
@iwadon
iwadon / gist:917629
Created April 13, 2011 14:22
FileUtils.touch :nocreate => true, :verbose => true でのメッセージを修正。
diff --git a/lib/fileutils.rb b/lib/fileutils.rb
index f2a6197..94af69a 100644
--- a/lib/fileutils.rb
+++ b/lib/fileutils.rb
@@ -1036,7 +1036,7 @@ module FileUtils
created = nocreate = options[:nocreate]
t = options[:mtime]
if options[:verbose]
- fu_output_message "touch #{nocreate ? ' -c' : ''}#{t ? t.strftime(' -t %Y%m%d%H%M.%S') : ''}#{list.join ' '}"
+ fu_output_message "touch #{nocreate ? '-c ' : ''}#{t ? t.strftime(' -t %Y%m%d%H%M.%S') : ''}#{list.join ' '}"
@iwadon
iwadon / pfop_sample.c
Created March 23, 2011 01:20
PathFindOnFile() sample.
/* cl pfop_sample.c shlwapi.lib */
#include <stdio.h>
#include <shlwapi.h>
int main()
{
BOOL bOk;
char buf[MAX_PATH] = {0};
@iwadon
iwadon / build-win32.ninja
Created March 22, 2011 10:16
a Ninja file for self building of Ninja win32 port with VC++
builddir = build-win32
o = obj
x = .exe
cxx = cl.exe -nologo
cflags = -EHsc -I. -Isrc -DWIN32
ldflags =
rule cxx
command = $cxx $cflags -Fo$out /c $in
description = CC $out
@iwadon
iwadon / bootstrap-win32.bat
Created March 22, 2011 10:14
a BAT file for the bootstrap of Ninja for Win32
cl.exe /nologo /EHsc /I. /Isrc /DWIN32 /Feninja-bootstrap.exe src\build.cc src\build_log.cc src\eval_env.cc src\graph.cc src\graphviz.cc src\parsers.cc src\subprocess.win32.cpp src\util.cc src\ninja_jumble.cc src\ninja.cc src\getopt.c shlwapi.lib && .\ninja-bootstrap.exe -f build-win32.ninja ninja.exe && del .\ninja-bootstrap.exe