cpp_build 0.0.2 → 0.0.3

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. checksums.yaml +4 -4
  2. data/lib/cpp_build.rb +13 -3
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7f37d40dc8ff2b28b0768e41f1d6425bdf68d675
4
- data.tar.gz: a528510c60a7652b2aaf46abd5db802346614f46
3
+ metadata.gz: f6bbbebbaba2074b5d02ec6b340c621c5cdde674
4
+ data.tar.gz: ddd7e7a2729aa60bdbee440b5b64a34de17583b5
5
5
  SHA512:
6
- metadata.gz: bcc09cbbe6cf7cc86c6b481c1642c3be4b71ac6fccaf6945ec896ccef38e183a60cb5084ae0d89b6aeac3cd14e70c3568bee0510acda1c45572c3ad8c1daaaa6
7
- data.tar.gz: b19d0434733f73db05720955d3b999f5b6a0d262cbe08fc7cc3efc1af3851b1924a7d296f775ab4a8c6196116fee2ae9c8d467e508d659794124e54b08493148
6
+ metadata.gz: b23ffe7d1f3dcfba91f208a5c8cda9419471fcfb19c58dc4d04bb4d01f3db6a770a5b8ae64f8c2a8420f49d06016da73a79b1bef73fe5b8f7c2504aa712ed869
7
+ data.tar.gz: 2b0c20c49ddd3cfd9579ee77af3b1d6e4903afd6bf62d3a2947cccd510314236ff45b9b8efe3ca0b20af582359f83e4c95f4d3e7959ad38dad036303f1154ebd
@@ -1,6 +1,6 @@
1
1
 
2
2
  # Builds a command line string for clang++
3
- def clang_compiler_build_str(out_name, files, inc_dirs, lib_dirs, libs, config)
3
+ def clang_compiler_build_str(out_name, files, inc_dirs, lib_dirs, libs, config, ex_linker_flags, ex_build_flags)
4
4
 
5
5
  # Compiler
6
6
  cc = "clang++"
@@ -37,14 +37,22 @@ def clang_compiler_build_str(out_name, files, inc_dirs, lib_dirs, libs, config)
37
37
  libs = ""
38
38
  end
39
39
 
40
+
41
+ #Extras
42
+ if ex_linker_flags.class == Array then ex_linker_flags = ex_linker_flags.join(" ") end
43
+ if ex_build_flags.class == Array then ex_build_flags = ex_build_flags.join(" ") end
44
+
45
+
40
46
  # Output
41
47
  build = "-o #{out_name}"
42
48
 
43
49
  # Other Stuff
44
50
  cpp_standard = "-std=c++11"
45
51
 
52
+ framework_dir = "" #"-F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/"
53
+
46
54
  # Build cmd string
47
- cmd_string = "#{cc} #{files} #{inc_dirs} #{lib_dirs} #{libs} #{config} #{cpp_standard} #{build}"
55
+ cmd_string = "#{cc} #{files} #{inc_dirs} #{lib_dirs} #{framework_dir} #{libs} #{ex_linker_flags} #{ex_build_flags} #{config} #{cpp_standard} #{build}"
48
56
 
49
57
  return cmd_string
50
58
  end
@@ -54,6 +62,8 @@ $build_list = []
54
62
  class CppBuild
55
63
 
56
64
  attr_accessor :name, :compiler, :files, :config, :inc_dirs, :lib_dirs, :libs, :arch, :defines, :out_dir
65
+ attr_accessor :extra_linker_flags
66
+ attr_accessor :extra_build_flags
57
67
 
58
68
  def initialize()
59
69
  @name = "cpp_build"
@@ -87,7 +97,7 @@ class CppBuild
87
97
  end
88
98
 
89
99
  if build.compiler == :clang
90
- compiler_cmd = clang_compiler_build_str(build.out_dir + build.name, build.files, build.inc_dirs, build.lib_dirs, build.libs, build.config)
100
+ compiler_cmd = clang_compiler_build_str(build.out_dir + build.name, build.files, build.inc_dirs, build.lib_dirs, build.libs, build.config, build.extra_linker_flags, build.extra_build_flags)
91
101
  else
92
102
  compiler_cmd = "echo \"Compiler not supported.\""
93
103
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cpp_build
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Phil CK