Skip to content

Commit 7e822ad

Browse files
Félix Enrique Llorente PastoraFélix Enrique Llorente Pastora
Félix Enrique Llorente Pastora
authored and
Félix Enrique Llorente Pastora
committedJan 21, 2013
Version handling for osx
1 parent 809dd7f commit 7e822ad

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed
 

‎shared_lib/make_osx.sh

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
#http://blog.zyxar.com/tag/executable_path
55
#https://wincent.com/wiki/@executable_path,_@load_path_and_@rpath
66
#http://www.mikeash.com/pyblog/friday-qa-2009-11-06-linking-and-install-names.html
7-
major=1
8-
minor=2
7+
major=A
8+
minor=1.0.1
9+
compatibility=1.0.0
910
mkdir -p out/libs
1011

1112
#Without major/minor
@@ -14,12 +15,11 @@ g++ -dynamiclib -o out/libs/libfoo.dylib -install_name @executable_path/libs/lib
1415

1516
#With major/minor
1617
g++ -c bar.cpp -o out/bar.o
17-
g++ -dynamiclib -o out/libs/libbar.dylib -install_name @executable_path/libs/libbar.dylib out/bar.o -compatibility_version 1 -current_version 1.2 out/libs/libfoo.dylib
18+
g++ -dynamiclib -o out/libs/libbar.$major.dylib -install_name @executable_path/libs/libbar.$major.dylib out/bar.o -compatibility_version $compatibility -current_version $minor out/libs/libfoo.dylib
1819
pushd out/libs
19-
ln -s libbar.$major.$minor.dylib libbar.dylib
20-
ln -s libbar.$major.$minor.dylib libbar.$major.dylib
20+
ln -s libbar.$major.dylib libbar.dylib
2121
popd
2222

2323
#Executable
2424
g++ -c main.cpp -o out/main.o
25-
g++ -o out/main.exe out/main.o out/libs/libfoo.dylib out/libs/libbar.dylib
25+
g++ -o out/main out/main.o -lfoo -lbar -Lout/libs/

‎shared_lib/project.rb

+5-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
:sources => ['foo.cpp']
44

55
bar = shared_lib 'bar',
6-
:major => 1,
7-
:minor => 2,
8-
:sources => ['bar.cpp']
6+
:major => 'A',
7+
:minor => '1.0.2',
8+
:compatibility => '1.0.1',
9+
:sources => ['bar.cpp'],
10+
:dependencies => ['foo']
911

1012
exe 'main',
1113
:sources => ['main.cpp'],

0 commit comments

Comments
 (0)
Please sign in to comment.