Skip to content

Commit

Permalink
Windows build changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuki Izumi authored and gjtorikian committed Oct 11, 2016
1 parent 5c96aa8 commit f57f96c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ end
Rake::Task['clean'].enhance do
ext_dir = File.join(File.dirname(__FILE__), 'ext', 'commonmarker', 'cmark')
Dir.chdir(ext_dir) do
`make clean`
host_os = RbConfig::CONFIG['host_os']
make = (host_os == 'mingw32') ? 'nmake.bat' : 'make'
`#{make} clean`
end
end

Expand Down
10 changes: 8 additions & 2 deletions ext/commonmarker/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,14 @@
FileUtils.mkdir_p(CMARK_BUILD_DIR)

Dir.chdir(CMARK_BUILD_DIR) do
system 'cmake .. -DCMAKE_C_FLAGS=-fPIC'
system 'make libcmark_static'
if host_os == 'mingw32'
make = 'nmake'
system 'cmake -G "NMake Makefiles" -D CMAKE_BUILD_TYPE= -D CMAKE_INSTALL_PREFIX=windows .."'
else
make = 'make'
system 'cmake .. -DCMAKE_C_FLAGS=-fPIC'
end
system "#{make} libcmark_static" or abort "make libcmark_static failed"
# rake-compiler seems to complain about this line, not sure why it's messing with it
FileUtils.rm_rf(File.join(CMARK_BUILD_DIR, 'Testing', 'Temporary'))
end
Expand Down

0 comments on commit f57f96c

Please sign in to comment.