forked from e-dant/watcher
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Will
committed
Jul 21, 2024
1 parent
bf1e655
commit c941f94
Showing
5 changed files
with
83 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,8 @@ source 'https://rubygems.org' | |
|
||
gemspec | ||
|
||
gem 'ffi' | ||
gem 'fiddle' | ||
gem 'rake' | ||
gem 'rspec' | ||
gem 'solargraph' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,24 @@ | ||
# frozen_string_literal: true | ||
|
||
require "bundler/gem_tasks" | ||
require "rspec/core/rake_task" | ||
require 'bundler/gem_tasks' | ||
require 'rspec/core/rake_task' | ||
|
||
RSpec::Core::RakeTask.new(:spec) | ||
|
||
task build_shared_library: ["lib"] do | ||
framework_deps = case RbConfig::CONFIG["host_os"] | ||
task build_shared_library: ['lib'] do | ||
case RbConfig::CONFIG['host_os'] | ||
when /darwin/ | ||
"-framework CoreServices -framework CoreFoundation" | ||
framework_deps = '-framework CoreServices -framework CoreFoundation' | ||
link_rpath = '-Wl,-rpath,/usr/local/lib' | ||
else | ||
"" | ||
framework_deps = '' | ||
link_rpath = '' | ||
end | ||
version = File.read("../.version").strip | ||
version = File.read('../.version').strip | ||
libname = "libwatcher-c-#{version}.so" | ||
sh "c++ -shared -std=c++17 -O2 #{framework_deps} ../watcher-c/src/watcher-c.cpp -I ../watcher-c/include -o lib/#{libname}" | ||
sources = '../watcher-c/src/watcher-c.cpp' | ||
includes = '../watcher-c/include' | ||
sh "c++ -shared -std=c++17 -O2 #{framework_deps} #{sources} -I #{includes} -o lib/#{libname} #{link_rpath}" | ||
end | ||
|
||
task default: [:clobber, :build_shared_library, :spec] | ||
task default: %i[clobber build_shared_library spec] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters