Rename STATICLIB macro to resolve natpmp/miniupnp conflict
Same macro name is used in both natpmp and miniupnp libraries so it's impossble to link one statically and another dynamically. This patch renames the macro to have library-specific name.
This commit is contained in:
parent
f841aa9e56
commit
f6774e3316
|
@ -86,7 +86,7 @@ endif (NOT WIN32 AND NOT CMAKE_SYSTEM_NAME STREQUAL "AmigaOS")
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
set_source_files_properties (${MINIUPNPC_SOURCES} PROPERTIES
|
set_source_files_properties (${MINIUPNPC_SOURCES} PROPERTIES
|
||||||
COMPILE_DEFINITIONS STATICLIB
|
COMPILE_DEFINITIONS MINIUPNP_STATICLIB
|
||||||
COMPILE_DEFINITIONS MINIUPNP_EXPORTS
|
COMPILE_DEFINITIONS MINIUPNP_EXPORTS
|
||||||
)
|
)
|
||||||
endif (WIN32)
|
endif (WIN32)
|
||||||
|
|
|
@ -50,11 +50,11 @@ dll/upnpc.o: upnpc.o
|
||||||
echo $@ generated with $<
|
echo $@ generated with $<
|
||||||
|
|
||||||
.c.o:
|
.c.o:
|
||||||
$(CC) $(CFLAGS) -DSTATICLIB -c -o $@ $<
|
$(CC) $(CFLAGS) -DMINIUPNP_STATICLIB -c -o $@ $<
|
||||||
$(CC) $(CFLAGS) -DMINIUPNP_EXPORTS -c -o dll/$@ $<
|
$(CC) $(CFLAGS) -DMINIUPNP_EXPORTS -c -o dll/$@ $<
|
||||||
|
|
||||||
upnpc.o:
|
upnpc.o:
|
||||||
$(CC) $(CFLAGS) -DSTATICLIB -c -o $@ $<
|
$(CC) $(CFLAGS) -DMINIUPNP_STATICLIB -c -o $@ $<
|
||||||
$(CC) $(CFLAGS) -c -o dll/$@ $<
|
$(CC) $(CFLAGS) -c -o dll/$@ $<
|
||||||
|
|
||||||
# --enable-stdcall-fixup
|
# --enable-stdcall-fixup
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef DECLSPEC_H_INCLUDED
|
#ifndef DECLSPEC_H_INCLUDED
|
||||||
#define DECLSPEC_H_INCLUDED
|
#define DECLSPEC_H_INCLUDED
|
||||||
|
|
||||||
#if defined(_WIN32) && !defined(STATICLIB)
|
#if defined(_WIN32) && !defined(MINIUPNP_STATICLIB)
|
||||||
/* for windows dll */
|
/* for windows dll */
|
||||||
#ifdef MINIUPNP_EXPORTS
|
#ifdef MINIUPNP_EXPORTS
|
||||||
#define LIBSPEC __declspec(dllexport)
|
#define LIBSPEC __declspec(dllexport)
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
* This software is subjet to the conditions detailed in the
|
* This software is subjet to the conditions detailed in the
|
||||||
* provided LICENCE file. */
|
* provided LICENCE file. */
|
||||||
#include <Python.h>
|
#include <Python.h>
|
||||||
#define STATICLIB
|
#define MINIUPNP_STATICLIB
|
||||||
#include "structmember.h"
|
#include "structmember.h"
|
||||||
#include "miniupnpc.h"
|
#include "miniupnpc.h"
|
||||||
#include "upnpcommands.h"
|
#include "upnpcommands.h"
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
Optimization="0"
|
Optimization="0"
|
||||||
PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;STATICLIB;DEBUG"
|
PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;MINIUPNP_STATICLIB;DEBUG"
|
||||||
MinimalRebuild="true"
|
MinimalRebuild="true"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
RuntimeLibrary="3"
|
RuntimeLibrary="3"
|
||||||
|
@ -104,7 +104,7 @@
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
Optimization="2"
|
Optimization="2"
|
||||||
EnableIntrinsicFunctions="true"
|
EnableIntrinsicFunctions="true"
|
||||||
PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;STATICLIB"
|
PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;MINIUPNP_STATICLIB"
|
||||||
RuntimeLibrary="2"
|
RuntimeLibrary="2"
|
||||||
EnableFunctionLevelLinking="true"
|
EnableFunctionLevelLinking="true"
|
||||||
UsePrecompiledHeader="0"
|
UsePrecompiledHeader="0"
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
Optimization="0"
|
Optimization="0"
|
||||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;STATICLIB;DEBUG;_CRT_SECURE_NO_WARNINGS"
|
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;MINIUPNP_STATICLIB;DEBUG;_CRT_SECURE_NO_WARNINGS"
|
||||||
MinimalRebuild="true"
|
MinimalRebuild="true"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
RuntimeLibrary="3"
|
RuntimeLibrary="3"
|
||||||
|
@ -115,7 +115,7 @@
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
Optimization="2"
|
Optimization="2"
|
||||||
EnableIntrinsicFunctions="true"
|
EnableIntrinsicFunctions="true"
|
||||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;STATICLIB"
|
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;MINIUPNP_STATICLIB"
|
||||||
RuntimeLibrary="2"
|
RuntimeLibrary="2"
|
||||||
EnableFunctionLevelLinking="true"
|
EnableFunctionLevelLinking="true"
|
||||||
UsePrecompiledHeader="0"
|
UsePrecompiledHeader="0"
|
||||||
|
|
Loading…
Reference in New Issue