extconf_compile_commands_json 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4ce6710866c4f07c500ab2585fd1fa1d40dcf7f5d8e00ecba008f8336de88dc4
4
- data.tar.gz: 2ac4f1f733c16de18a0e255c42346fbc6ded34cff9af1addb7d5409790feb792
3
+ metadata.gz: 3c739766b7103843b06349b2c4b2009c3f03575f263310b726ecdd1f43be2656
4
+ data.tar.gz: 8df257ed2d7c2941c3673b8734e34413fd9a49f8f2302519792f885c543fe49c
5
5
  SHA512:
6
- metadata.gz: 94e624a0c3922c37081847ab63d8f59fa355046bbdbee9c244db6e596b346eaabd417ab75b4106dd38efb36bf23d57861cddcd465eeb81353028f03473a15b94
7
- data.tar.gz: 124ebd14ce40fa8ac4ec560611a08e2d687ecfa19be0e48af5952885e72436e3f63cf9f09f925676ee61ebe5d63ae141144d06d87c492a388933cede3604bb8d
6
+ metadata.gz: 68280f4d6d5e84cfc6e7444918ac7a0579a97806e9e318473cefc8daa0822cbbd42a04eb17e49508b4d95453c3ea2021445559376f962fbc36e730e12cb16dd9
7
+ data.tar.gz: 83b390d94c7ee493a32decad39745c42c23efc5a4ce31abc49bde6906ad32210b77cc636819fc041c5c7fbabf51bb5d4e4d3fc2a46a9cdc9d3b2a6d0aff1b923
@@ -7,15 +7,10 @@ require "fileutils"
7
7
 
8
8
  module ExtconfCompileCommandsJson
9
9
  def self.generate!
10
- mkmf_cflags = []
11
10
  # Start by expanding what's in our magic variables
12
- [$INCFLAGS, $CPPFLAGS, $CFLAGS, $COUTFLAGS].each do |v|
13
- next unless v
14
- mkmf_cflags.concat Shellwords.split(v)
15
- end
16
- # expand that with the contents of the ruby options
17
- mkmf_cflags.map! do |flag|
18
- flag
11
+ mkmf_cflags = [$INCFLAGS, $CPPFLAGS, $CFLAGS, $COUTFLAGS].map { |flag|
12
+ # expand that with the contents of the ruby options
13
+ (flag || "")
19
14
  .gsub("$(arch_hdrdir)", $arch_hdrdir || "")
20
15
  .gsub("$(hdrdir)", $hdrdir || "")
21
16
  .gsub("$(srcdir)", $srcdir || "")
@@ -27,8 +22,12 @@ module ExtconfCompileCommandsJson
27
22
  .gsub("$(debugflags)", RbConfig::CONFIG["debugflags"] || "")
28
23
  .gsub("$(warnflags)", RbConfig::CONFIG["warnflags"] || "")
29
24
  .gsub("$(empty)", "")
30
- end
31
- mkmf_cflags.reject! { |f| f.empty? }
25
+ }.flat_map { |flags|
26
+ # Need to shellwords expand them (_after_ doing the $() subst's)
27
+ Shellwords.split(flags)
28
+ }.reject { |flag|
29
+ flag.empty?
30
+ }
32
31
  # This makes sure that #include "extconf.h" works
33
32
  mkmf_cflags = ["-iquote#{File.realpath(Dir.pwd)}"] + mkmf_cflags
34
33
  compile_commands = $srcs.map do |src|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: extconf_compile_commands_json
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - KJ Tsanaktsidis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-05 00:00:00.000000000 Z
11
+ date: 2022-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: standard