Skip to content

Commit

Permalink
Fixed the shared library build by adding -fPIC to the common.gyp for …
Browse files Browse the repository at this point in the history
…both debug and release builds.
  • Loading branch information
kellabyte committed Jul 18, 2013
1 parent 87125b6 commit d920dd9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
'configurations': {
'debug': {
'defines': [ 'DEBUG', '_DEBUG' ],
'cflags': [ '-g', '-O0', '-fwrapv' ],
'cflags': [ '-g', '-O0', '-fwrapv', '-fPIC' ],
'msvs_settings': {
'VCCLCompilerTool': {
'target_conditions': [
Expand Down Expand Up @@ -55,6 +55,7 @@
'-fomit-frame-pointer',
'-fdata-sections',
'-ffunction-sections',
'-fPIC',
],
'msvs_settings': {
'VCCLCompilerTool': {
Expand Down
4 changes: 2 additions & 2 deletions haywire.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@
# haywire shared library
########################################
{
'target_name': 'libhaywire',
'product_name': 'libhaywire',
'target_name': 'haywire_shared',
'product_name': 'haywire',
'type': 'shared_library',
'msvs_guid': '5ECEC9E5-8F23-47B6-93E0-C3B328B3BE65',

Expand Down
5 changes: 4 additions & 1 deletion include/haywire.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@
#define HAYWIRE_EXTERN /* nothing */
#endif
#endif

#define HAYWIRE_CALLING_CONVENTION __cdecl
#else
/* Building static library. */
#define HAYWIRE_EXTERN /* nothing */
#define HAYWIRE_CALLING_CONVENTION /* nothing */
#endif

/* Informational 1xx */
Expand Down Expand Up @@ -154,7 +157,7 @@ typedef struct
typedef void* hw_http_response;
typedef char hw_http_method;

typedef hw_http_response* (__cdecl *http_request_callback)(http_request* request);
typedef hw_http_response* (HAYWIRE_CALLING_CONVENTION *http_request_callback)(http_request* request);
extern http_request_callback http_req_callback;

HAYWIRE_EXTERN int hw_init_from_config(char* configuration_filename);
Expand Down

0 comments on commit d920dd9

Please sign in to comment.