diff options
author | Timothy Gu <timothygu99@gmail.com> | 2015-03-15 16:35:22 -0700 |
---|---|---|
committer | Timothy Gu <timothygu99@gmail.com> | 2015-03-15 17:00:40 -0700 |
commit | 5ea707adea4146a64c38106a9bad11b01f74f0ef (patch) | |
tree | 40d22b482595a05fa25653407bafb2da2be3ed7d | |
parent | c421b7010d915a36bfc90c4f0462095ea840bb7a (diff) | |
download | dlfcn-win32-5ea707adea4146a64c38106a9bad11b01f74f0ef.tar.gz dlfcn-win32-5ea707adea4146a64c38106a9bad11b01f74f0ef.tar.bz2 dlfcn-win32-5ea707adea4146a64c38106a9bad11b01f74f0ef.zip |
Define SHARED when building shared library
-rw-r--r-- | CMakeLists.txt | 4 | ||||
-rw-r--r-- | Makefile | 1 | ||||
-rw-r--r-- | visual-studio/12/dl/dl.vcxproj | 4 |
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) | |||
13 | set(headers dlfcn.h) | 13 | set(headers dlfcn.h) |
14 | set(sources dlfcn.c) | 14 | set(sources dlfcn.c) |
15 | 15 | ||
16 | if (BUILD_SHARED_LIBS) | ||
17 | add_definitions(-DSHARED) | ||
18 | endif (BUILD_SHARED_LIBS) | ||
19 | |||
16 | add_library(dl ${sources}) | 20 | add_library(dl ${sources}) |
17 | 21 | ||
18 | install (TARGETS dl RUNTIME DESTINATION bin | 22 | install (TARGETS dl RUNTIME DESTINATION bin |
@@ -7,6 +7,7 @@ CFLAGS=-Wall -O3 -fomit-frame-pointer | |||
7 | ifeq ($(BUILD_SHARED),yes) | 7 | ifeq ($(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 |
11 | endif | 12 | endif |
12 | ifeq ($(BUILD_STATIC),yes) | 13 | 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 @@ | |||
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> |