-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrakefile.rb
137 lines (104 loc) · 3.62 KB
/
rakefile.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
myDir = File.dirname(__FILE__);
require "#{myDir}/build-options.rb"
Git = Rakish::Git;
task :buildTools => [] do
config = Rakish::BuildConfig("root");
targetPlatform = config.targetPlatform;
if(targetPlatform =~ /MacOS/)
puts("Configuring for MacOS\n\n");
ret = `which brew`;
unless(ret =~ /homebrew\/bin\/brew/ )
Rakish.log.error( "\n##### homebrew is required to run this build");
puts( "\nTo install: \n");
puts( "Launch Terminal.");
puts( "Write the following command:");
puts( "/bin/zsh -c \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\" → hit return.");
puts( "Now, enter your Mac password. Hit the return key on your keyboard to continue.\n\n\n");
Rakish.log.error( "\n##### Exiting");
exit(0);
end
ret = `which python3`;
unless(ret =~ /homebrew\/bin\/python3/ )
system('brew install python3')
end
ret = `which pip`;
unless(ret =~ /homebrew\/bin\/pip/ )
system('python3 -m ensurepip --updradeip --upgrade')
end
ret = `which conan`;
unless(ret =~ /homebrew\/bin\/conan/ )
system('pip install conan==1.95.0')
end
ret = `which cmake`;
unless(ret =~ /homebrew\/bin\/cmake/ )
system('brew install cmake')
end
else
Rakish.log.error("Target platform #{targetPlatform} not yet supported");
Rakish.log.error( "\n##### Exiting");
exit(0);
end
end
task :nativeLibs => [ :buildTools ]do
FileUtils.cd "./third-party" do
system("rake setup");
end
FileUtils.cd "./native-libs" do
system("rake setup");
end
end
task :setup => [:buildTools, :nativeLibs] do
puts "setup complete."
end
task :resources => [] do
end
subdirs=[]
unless Rakish.inSetupTask()
subdirs = [
'./native-libs',
'./third-party',
];
end
Rakish.Project(
:includes=>[Rakish::CppProjectModule, Rakish::GitModule ],
:name => "artd-root",
:dependsUponOpt => subdirs
) do
export task :cleanAll => sourceSubdir do |t|
FileUtils.rm_rf(buildDir); # remove recursive
end
task :runConfigs do
if(targetPlatform =~ /MacOS/)
FileUtils.mkdir_p ("#{buildDir}/#{projectName}.xcodeproj/xcshareddata/xcschemes");
FileUtils.cp_r( "#{projectDir}/build-scripts/xcodeproj/xcshareddata/xcschemes/.", "#{buildDir}/#{projectName}.xcodeproj/xcshareddata/xcschemes");
end
end
task :projectFiles do
FileUtils.mkdir_p("./build")
FileUtils.cd("./build") do
cmd = "#{cmakeCommand} -G \"#{cMakeGenerator}\" -DWEBGPU_BACKEND=DAWN"
cmd += " ..";
system(cmd);
end
end
export task :genProject => [ :projectFiles, :runConfigs ] do
end
setupCppConfig :targetType =>'NONE' do |cfg|
end
end # end project artd-lib
unless Rakish.inSetupTask()
task :vendorLibs;
task :nativeLibs => [ :vendorLibs, :autogen, :genProject, :build ] do
end
end
# # You can disable password authentication with -o PasswordAuthentication=no. Full command would be:
# # ssh -nT -o PasswordAuthentication=no <host> # n no stdout output, T no tty input.
# # GIT_SSH_COMMAND=ssh -o PasswordAuthentication=no'
#
# # task :testSetup => [ :thirdPartySetup, :libCppSetup ] do
# # if(Git.cloneIfAvailable("git.livingwork.com:/home/artd/newartd/artdlib-test", "#{myDir}/artdlib-test"))
# # cd "#{myDir}/artdlib-test" do
# # system("rake setup");
# # end
# # end
# # end