extconf_compile_commands_json 0.0.3 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/extconf_compile_commands_json/autoload.rb +11 -9
- data/lib/extconf_compile_commands_json.rb +9 -10
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c739766b7103843b06349b2c4b2009c3f03575f263310b726ecdd1f43be2656
|
4
|
+
data.tar.gz: 8df257ed2d7c2941c3673b8734e34413fd9a49f8f2302519792f885c543fe49c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68280f4d6d5e84cfc6e7444918ac7a0579a97806e9e318473cefc8daa0822cbbd42a04eb17e49508b4d95453c3ea2021445559376f962fbc36e730e12cb16dd9
|
7
|
+
data.tar.gz: 83b390d94c7ee493a32decad39745c42c23efc5a4ce31abc49bde6906ad32210b77cc636819fc041c5c7fbabf51bb5d4e4d3fc2a46a9cdc9d3b2a6d0aff1b923
|
@@ -11,14 +11,16 @@ require "mkmf"
|
|
11
11
|
# needing to muck about with $LOAD_PATH or Bundler.
|
12
12
|
require_relative "../extconf_compile_commands_json"
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
14
|
+
# We have to patch MakeMakefile directly, rather than prepending to it, because
|
15
|
+
# requiring mkmf includes it into the toplevel main object straight away. So prepending
|
16
|
+
# here would be too late.
|
17
|
+
|
18
|
+
module MakeMakefile
|
19
|
+
alias_method :__extconfcc_orig_create_makefile, :create_makefile
|
20
|
+
def create_makefile(*args)
|
21
|
+
r = __extconfcc_orig_create_makefile(*args)
|
22
|
+
ExtconfCompileCommandsJson.generate!
|
23
|
+
ExtconfCompileCommandsJson.symlink!
|
24
|
+
r
|
21
25
|
end
|
22
26
|
end
|
23
|
-
|
24
|
-
MakeMakefile.prepend ExtconfCompileCommandsJson::AutoloadPatch
|
@@ -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].
|
13
|
-
|
14
|
-
|
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
|
-
|
31
|
-
|
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.
|
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-
|
11
|
+
date: 2022-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: standard
|