Skip to content

Commit

Permalink
allow physac to be built as a shared library (#2168)
Browse files Browse the repository at this point in the history
if `BUILD_LIBTYPE_SHARED` is defined allow build as a shared dll
  • Loading branch information
jasonswearingen authored Nov 23, 2021
1 parent 460eba5 commit c5fc7c7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/extras/physac.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,16 @@
#if !defined(PHYSAC_H)
#define PHYSAC_H

// Function specifiers in case library is build/used as a shared library (Windows)
// NOTE: Microsoft specifiers to tell compiler that symbols are imported/exported from a .dll
#if defined(_WIN32)
#if defined(BUILD_LIBTYPE_SHARED)
#define PHYSACDEF __declspec(dllexport) // We are building the library as a Win32 shared library (.dll)
#elif defined(USE_LIBTYPE_SHARED)
#define PHYSACDEF __declspec(dllimport) // We are using the library as a Win32 shared library (.dll)
#endif
#endif

#ifndef PHYSACDEF
#define PHYSACDEF // We are building or using physac as a static library
#endif
Expand Down

0 comments on commit c5fc7c7

Please sign in to comment.