File tree 2 files changed +11
-9
lines changed
2 files changed +11
-9
lines changed Original file line number Diff line number Diff line change 4
4
# http://blog.zyxar.com/tag/executable_path
5
5
# https://wincent.com/wiki/@executable_path,_@load_path_and_@rpath
6
6
# 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
9
10
mkdir -p out/libs
10
11
11
12
# Without major/minor
@@ -14,12 +15,11 @@ g++ -dynamiclib -o out/libs/libfoo.dylib -install_name @executable_path/libs/lib
14
15
15
16
# With major/minor
16
17
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
18
19
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
21
21
popd
22
22
23
23
# Executable
24
24
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/
Original file line number Diff line number Diff line change 3
3
:sources => [ 'foo.cpp' ]
4
4
5
5
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' ]
9
11
10
12
exe 'main' ,
11
13
:sources => [ 'main.cpp' ] ,
You can’t perform that action at this time.
0 commit comments