From 48949bd3ebd66bb94a40f4c3fcfb26dd4bf2be2b Mon Sep 17 00:00:00 2001 From: past-due <30942300+past-due@users.noreply.github.com> Date: Sun, 29 Apr 2018 21:37:12 -0400 Subject: Static library support improvements (#123) * `#define UTF8PROC_STATIC` to disable DLLEXPORT `#define UTF8PROC_STATIC` to disable DLLEXPORT * [CMake] Automatically define UTF8PROC_STATIC if BUILD_SHARED_LIBS is off * [Makefile] Support additional UTF8PROC_DEFINES, which can be used to specify flags like `-DUTF8PROC_STATIC` --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index cbc8d93..d07dee1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,13 @@ add_library (utf8proc utf8proc.h ) +if (BUILD_SHARED_LIBS) + # Building shared library +else() + # Building static library + target_compile_definitions(utf8proc PUBLIC "UTF8PROC_STATIC") +endif() + target_compile_definitions(utf8proc PRIVATE "UTF8PROC_EXPORTS") set_target_properties (utf8proc PROPERTIES -- cgit v1.2.3