cgen 0.16.7 → 0.16.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/History.txt +4 -0
  2. data/lib/cgen/cgen.rb +10 -2
  3. metadata +5 -5
@@ -1,3 +1,7 @@
1
+ cgen 0.16.8
2
+
3
+ - added Library#include_dirs for setting include path
4
+
1
5
  cgen 0.16.7
2
6
 
3
7
  - misc refactoring, cleanup, docs, error checking
@@ -418,7 +418,7 @@ require 'cgen/inherit'
418
418
  # way that makes clear that the problem is really with commit.
419
419
  module CGenerator
420
420
 
421
- VERSION = '0.16.7'
421
+ VERSION = '0.16.8'
422
422
 
423
423
  class Accumulator ## should be a mixin? "Cumulative"?
424
424
 
@@ -597,6 +597,10 @@ class Library < Template
597
597
  # lists all .c files that are in the source dir. If you do not delete obsolete
598
598
  # files, they will be compiled into your library!
599
599
  attr_accessor :purge_source_dir
600
+
601
+ # Array of dirs which will be searched for extra include files. Example:
602
+ # lib.include_dirs << "/home/me/include"
603
+ attr_reader :include_dirs
600
604
 
601
605
  def initialize name
602
606
  super name
@@ -604,6 +608,7 @@ class Library < Template
604
608
  @show_times_flag = @purge_source_dir = false
605
609
  @committed = false
606
610
  @source_file = nil
611
+ @include_dirs = []
607
612
 
608
613
  @rtime = Time.now.to_f
609
614
  @ptime = process_times
@@ -893,7 +898,7 @@ class Library < Template
893
898
  return if Dir[cpat].all? {|f| test ?<, f, dep}
894
899
 
895
900
  cfg = Config::CONFIG
896
- dirs = [cfg["sitearchdir"], cfg["archdir"], cfg["includedir"]]
901
+ dirs = [cfg["sitearchdir"], cfg["archdir"], cfg["includedir"], *include_dirs]
897
902
 
898
903
  case cfg["CC"]
899
904
  when /gcc/
@@ -1032,6 +1037,9 @@ class Library < Template
1032
1037
  a = []
1033
1038
  a << "require 'mkmf'"
1034
1039
  a << "$CFLAGS = \"#$CFLAGS\"" if defined?($CFLAGS)
1040
+ include_dirs.each do |dir|
1041
+ a << %{$INCFLAGS << " -I#{dir}"}
1042
+ end
1035
1043
  yield a if block_given?
1036
1044
  a << "create_makefile '#{@name}'"
1037
1045
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cgen
3
3
  version: !ruby/object:Gem::Version
4
- hash: 81
4
+ hash: 79
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 16
9
- - 7
10
- version: 0.16.7
9
+ - 8
10
+ version: 0.16.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - Joel VanderWerf
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-08-11 00:00:00 -07:00
18
+ date: 2010-08-17 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -124,6 +124,6 @@ signing_key:
124
124
  specification_version: 3
125
125
  summary: C code generator
126
126
  test_files:
127
- - test/test-cgen.rb
128
127
  - test/test-attribute.rb
128
+ - test/test-cgen.rb
129
129
  - test/test-cshadow.rb