Skip to content

Commit 631f00d

Browse files
committed
Align with commit to RubyGems. See ruby/rubygems#8753.
1 parent c6e18f3 commit 631f00d

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

lib/rubygems/cmake_builder.rb

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,44 +31,39 @@
3131

3232
class Gem::Ext::CmakeBuilder
3333
attr_accessor :runner, :profile
34-
3534
def initialize
3635
@runner = self.class.method(:run)
3736
@profile = :release
3837
end
3938

40-
def build(extension, dest_path, results, args = [], lib_dir = nil, cmake_dir = Dir.pwd, target_rbconfig = Gem.target_rbconfig)
39+
def build(extension, dest_path, results, args = [], lib_dir = nil, cmake_dir = Dir.pwd,
40+
target_rbconfig = Gem.target_rbconfig)
4141
if target_rbconfig.path
4242
warn "--target-rbconfig is not yet supported for CMake extensions. Ignoring"
4343
end
4444

45-
# Make sure lib dir is set
46-
unless lib_dir
47-
lib_dir ||= File.join(dest_path, "lib")
48-
end
49-
5045
# Figure the build dir
5146
build_dir = File.join(cmake_dir, "build")
5247

5348
# Check if the gem defined presets
5449
check_presets(cmake_dir, args, results)
5550

5651
# Configure
57-
configure(cmake_dir, build_dir, lib_dir, args, results)
52+
configure(cmake_dir, build_dir, dest_path, args, results)
5853

5954
# Compile
6055
compile(cmake_dir, build_dir, args, results)
6156

6257
results
6358
end
6459

65-
def configure(cmake_dir, build_dir, lib_dir, args, results)
60+
def configure(cmake_dir, build_dir, install_dir, args, results)
6661
cmd = ["cmake",
6762
cmake_dir,
6863
"-B",
6964
build_dir,
70-
"-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=#{lib_dir}", # Windows
71-
"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=#{lib_dir}", # Not Windows
65+
"-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=#{install_dir}", # Windows
66+
"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=#{install_dir}", # Not Windows
7267
*Gem::Command.build_args,
7368
*args]
7469

0 commit comments

Comments
 (0)