Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds support for m1 chips #89

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Binary file modified bin/fsevent_watch
Binary file not shown.
8 changes: 2 additions & 6 deletions ext/fsevent_watch/defines.h
Expand Up @@ -14,12 +14,8 @@
#define COMPILER "unknown"
#endif

#if defined(__ppc__)
#define TARGET_CPU "ppc"
#elif defined(__ppc64__)
#define TARGET_CPU "ppc64"
#elif defined(__i386__)
#define TARGET_CPU "i386"
#if defined(__arm64__)
#define TARGET_CPU "arm64"
#elif defined(__x86_64__)
#define TARGET_CPU "x86_64"
#else
Expand Down
19 changes: 9 additions & 10 deletions ext/rakefile.rb
Expand Up @@ -38,12 +38,16 @@

$CCVersion = `#{$CC} --version | head -n 1`.strip


CLEAN.include OBJ.map(&:to_s)
CLEAN.include $obj_dir.join('Info.plist').to_s
CLEAN.include $obj_dir.join('fsevent_watch').to_s
CLOBBER.include $final_exe.to_s

task :determine_arch_type do
return if ENV['ARCHFLAGS']
# replace archflags if we're on apple silicon
$ARCHFLAGS = '-arch arm64 -arch x86_64' if $arch == 'arm64'
end

task :sw_vers do
$mac_product_version = `sw_vers -productVersion`.strip
Expand Down Expand Up @@ -84,22 +88,17 @@
end
end

desc 'set build arch to ppc'
task :ppc do
$ARCHFLAGS = '-arch ppc'
end

desc 'set build arch to x86_64'
task :x86_64 do
$ARCHFLAGS = '-arch x86_64'
end

desc 'set build arch to i386'
task :x86 do
$ARCHFLAGS = '-arch i386'
desc 'set build arch to arm64'
task :arm64 do
$ARCHFLAGS = '-arch arm64'
end

task :setup_env => [:set_build_type, :sw_vers, :get_sdk_info]
task :setup_env => [:set_build_type, :determine_arch_type, :sw_vers, :get_sdk_info]

directory $obj_dir.to_s
file $obj_dir.to_s => :setup_env
Expand Down
2 changes: 1 addition & 1 deletion lib/rb-fsevent/version.rb
@@ -1,5 +1,5 @@
# -*- encoding: utf-8 -*-

class FSEvent
VERSION = '0.10.4'
VERSION = '0.11.0'
end