File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed
Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,14 @@ bin = File.join(__dir__, "bin")
1111
1212Rake ::ExtensionTask . new ( "rbs_extension" )
1313
14+ compile_task = Rake ::Task [ :compile ]
15+
16+ task :setup_extconf_compile_commands_json do
17+ ENV [ "COMPILE_COMMANDS_JSON" ] = "1"
18+ end
19+
20+ compile_task . prerequisites . unshift ( :setup_extconf_compile_commands_json )
21+
1422test_config = lambda do |t |
1523 t . libs << "test"
1624 t . libs << "lib"
Original file line number Diff line number Diff line change 2626
2727create_makefile 'rbs_extension'
2828
29- require 'extconf_compile_commands_json'
30- ExtconfCompileCommandsJson . generate!
31- ExtconfCompileCommandsJson . symlink!
29+ # Only generate compile_commands.json when compiling through Rake tasks
30+ # This is to avoid adding extconf_compile_commands_json as a runtime dependency
31+ if ENV [ "COMPILE_COMMANDS_JSON" ]
32+ require 'extconf_compile_commands_json'
33+ ExtconfCompileCommandsJson . generate!
34+ ExtconfCompileCommandsJson . symlink!
35+ end
You can’t perform that action at this time.
0 commit comments