Last active
October 16, 2015 17:49
-
-
Save sheldonth/a8346b1ca31ffee82f7a to your computer and use it in GitHub Desktop.
Building dynamic link libraries in OSX
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
{ | |
"targets": [ | |
{ | |
"target_name": "NodeActiveTickAddon", | |
"sources": [ "NodeActiveTickAddon.cpp", | |
"NodeActiveTick.cpp", | |
"Requestor.cpp", | |
"import/atfeed-cppsdk/example/Helper.cpp", | |
"AtEnumConverter.cpp", | |
"protobuf/messages.pb.cc" | |
], | |
'include_dirs': [ | |
'./import/atfeed-cppsdk/include/', | |
"<!(node -e \"require('nan')\")" | |
], | |
"cflags": ['-c -O3 -ffast-math -fexpensive-optimizations -DNDEBUG -fexceptions -std=c++11'], | |
"cflags_cc": ['-c -O3 -ffast-math -fexpensive-optimizations -DNDEBUG -fexceptions'], | |
'cflags!': [ '-fno-rtti' ], | |
'cflags_cc!': [ '-fno-rtti' ], | |
'conditions': [ | |
['OS=="mac"', { | |
'xcode_settings': { | |
'MACOSX_DEPLOYMENT_TARGET': '10.11', | |
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES', | |
'GCC_ENABLE_CPP_RTTI': 'YES', | |
'OTHER_CPLUSPLUSFLAGS': [ | |
], | |
'OTHER_CFLAGS': [ | |
'<!@(pkg-config --cflags protobuf)' | |
], | |
'OTHER_LDFLAGS': [ | |
] | |
}, | |
'link_settings': { | |
'libraries': [ | |
'<(module_root_dir)/libActiveTickServerAPI.dylib', | |
'-lpthread', | |
'-D_THREAD_SAFE', | |
'<!@(pkg-config --libs protobuf)' | |
] | |
} | |
}], | |
['OS=="linux"', { | |
'link_settings': { | |
'ldflags': [ | |
], | |
'libraries':[ | |
'<(module_root_dir)/libActiveTickServerAPI.so', | |
'-lpthread', | |
'<!@(pkg-config --libs protobuf)' | |
] | |
} | |
}], | |
] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So really I suppose my question is how do I set up the Mac build settings so that the library is reliably linked?