aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Gu <timothygu99@gmail.com>2015-03-15 16:35:22 -0700
committerTimothy Gu <timothygu99@gmail.com>2015-03-15 17:00:40 -0700
commit5ea707adea4146a64c38106a9bad11b01f74f0ef (patch)
tree40d22b482595a05fa25653407bafb2da2be3ed7d
parentc421b7010d915a36bfc90c4f0462095ea840bb7a (diff)
downloaddlfcn-win32-5ea707adea4146a64c38106a9bad11b01f74f0ef.tar.gz
dlfcn-win32-5ea707adea4146a64c38106a9bad11b01f74f0ef.tar.bz2
dlfcn-win32-5ea707adea4146a64c38106a9bad11b01f74f0ef.zip
Define SHARED when building shared library
-rw-r--r--CMakeLists.txt4
-rw-r--r--Makefile1
-rw-r--r--visual-studio/12/dl/dl.vcxproj4
3 files changed, 9 insertions, 0 deletions
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)
13set(headers dlfcn.h) 13set(headers dlfcn.h)
14set(sources dlfcn.c) 14set(sources dlfcn.c)
15 15
16if (BUILD_SHARED_LIBS)
17 add_definitions(-DSHARED)
18endif (BUILD_SHARED_LIBS)
19
16add_library(dl ${sources}) 20add_library(dl ${sources})
17 21
18install (TARGETS dl RUNTIME DESTINATION bin 22install (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
7ifeq ($(BUILD_SHARED),yes) 7ifeq ($(BUILD_SHARED),yes)
8 TARGETS += libdl.dll 8 TARGETS += libdl.dll
9 SHFLAGS += -Wl,--out-implib,libdl.dll.a 9 SHFLAGS += -Wl,--out-implib,libdl.dll.a
10 CFLAGS += -DSHARED
10 INSTALL += shared-install 11 INSTALL += shared-install
11endif 12endif
12ifeq ($(BUILD_STATIC),yes) 13ifeq ($(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 @@
125 <WarningLevel>Level4</WarningLevel> 125 <WarningLevel>Level4</WarningLevel>
126 <Optimization>Disabled</Optimization> 126 <Optimization>Disabled</Optimization>
127 <SDLCheck>true</SDLCheck> 127 <SDLCheck>true</SDLCheck>
128 <PreprocessorDefinitions>SHARED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
128 </ClCompile> 129 </ClCompile>
129 <Link> 130 <Link>
130 <GenerateDebugInformation>true</GenerateDebugInformation> 131 <GenerateDebugInformation>true</GenerateDebugInformation>
@@ -155,6 +156,7 @@
155 <WarningLevel>Level4</WarningLevel> 156 <WarningLevel>Level4</WarningLevel>
156 <Optimization>Disabled</Optimization> 157 <Optimization>Disabled</Optimization>
157 <SDLCheck>true</SDLCheck> 158 <SDLCheck>true</SDLCheck>
159 <PreprocessorDefinitions>SHARED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
158 </ClCompile> 160 </ClCompile>
159 <Link> 161 <Link>
160 <GenerateDebugInformation>true</GenerateDebugInformation> 162 <GenerateDebugInformation>true</GenerateDebugInformation>
@@ -195,6 +197,7 @@
195 <FunctionLevelLinking>true</FunctionLevelLinking> 197 <FunctionLevelLinking>true</FunctionLevelLinking>
196 <IntrinsicFunctions>true</IntrinsicFunctions> 198 <IntrinsicFunctions>true</IntrinsicFunctions>
197 <SDLCheck>true</SDLCheck> 199 <SDLCheck>true</SDLCheck>
200 <PreprocessorDefinitions>SHARED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
198 </ClCompile> 201 </ClCompile>
199 <Link> 202 <Link>
200 <GenerateDebugInformation>true</GenerateDebugInformation> 203 <GenerateDebugInformation>true</GenerateDebugInformation>
@@ -209,6 +212,7 @@
209 <FunctionLevelLinking>true</FunctionLevelLinking> 212 <FunctionLevelLinking>true</FunctionLevelLinking>
210 <IntrinsicFunctions>true</IntrinsicFunctions> 213 <IntrinsicFunctions>true</IntrinsicFunctions>
211 <SDLCheck>true</SDLCheck> 214 <SDLCheck>true</SDLCheck>
215 <PreprocessorDefinitions>SHARED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
212 </ClCompile> 216 </ClCompile>
213 <Link> 217 <Link>
214 <GenerateDebugInformation>true</GenerateDebugInformation> 218 <GenerateDebugInformation>true</GenerateDebugInformation>