From 5ea707adea4146a64c38106a9bad11b01f74f0ef Mon Sep 17 00:00:00 2001 From: Timothy Gu Date: Sun, 15 Mar 2015 16:35:22 -0700 Subject: Define SHARED when building shared library --- CMakeLists.txt | 4 ++++ Makefile | 1 + visual-studio/12/dl/dl.vcxproj | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6dcf8a3..972ffb4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,10 @@ option(BUILD_TESTS "tests?" OFF) set(headers dlfcn.h) set(sources dlfcn.c) +if (BUILD_SHARED_LIBS) + add_definitions(-DSHARED) +endif (BUILD_SHARED_LIBS) + add_library(dl ${sources}) install (TARGETS dl RUNTIME DESTINATION bin diff --git a/Makefile b/Makefile index 2b03051..0f32932 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,7 @@ CFLAGS=-Wall -O3 -fomit-frame-pointer ifeq ($(BUILD_SHARED),yes) TARGETS += libdl.dll SHFLAGS += -Wl,--out-implib,libdl.dll.a + CFLAGS += -DSHARED INSTALL += shared-install endif ifeq ($(BUILD_STATIC),yes) diff --git a/visual-studio/12/dl/dl.vcxproj b/visual-studio/12/dl/dl.vcxproj index 6062cad..cea69bd 100644 --- a/visual-studio/12/dl/dl.vcxproj +++ b/visual-studio/12/dl/dl.vcxproj @@ -125,6 +125,7 @@ Level4 Disabled true + SHARED;%(PreprocessorDefinitions) true @@ -155,6 +156,7 @@ Level4 Disabled true + SHARED;%(PreprocessorDefinitions) true @@ -195,6 +197,7 @@ true true true + SHARED;%(PreprocessorDefinitions) true @@ -209,6 +212,7 @@ true true true + SHARED;%(PreprocessorDefinitions) true -- cgit v1.2.3-55-g6feb