Skip to content

Commit

Permalink
Added LM_STATIC preprocessor flag when doing a static build
Browse files Browse the repository at this point in the history
  • Loading branch information
Overhatted committed Nov 17, 2024
1 parent 04830fb commit bdfa20d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ set(LIBMEM_DEPS

if (LIBMEM_BUILD_STATIC)
add_library(libmem STATIC ${LIBMEM_SRC})
target_compile_definitions(libmem PUBLIC LM_STATIC)
else()
add_library(libmem SHARED ${LIBMEM_SRC})
endif()
Expand Down
10 changes: 7 additions & 3 deletions include/libmem/api.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,14 @@
#endif

/* Resolve import/export */
#ifdef LM_EXPORT
# define LM_API LM_API_EXPORT
#ifdef LM_STATIC
# define LM_API
#else
# define LM_API LM_API_IMPORT
# ifdef LM_EXPORT
# define LM_API LM_API_EXPORT
# else
# define LM_API LM_API_IMPORT
# endif
#endif

/* Calling convention */
Expand Down

0 comments on commit bdfa20d

Please sign in to comment.