Skip to content
This repository was archived by the owner on Feb 20, 2021. It is now read-only.

Add a KCBV2_STATIC symbol for static lib compilation #18

Open
wants to merge 1 commit into
base: 2.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions KCBv2/KCBv2Lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,16 @@ See the Apache 2 License for the specific language governing permissions and lim
#include <Kinect.h> // will need $(KINECTSDK20_DIR)inc; in the includes directory for project

#ifdef WIN32
#ifdef KCBV2_EXPORTS
#define KINECT_CB __declspec(dllexport)
#ifdef KCBV2_STATIC
#define KINECT_CB
#else
#define KINECT_CB __declspec(dllimport)
#pragma comment (lib, "KCBv2") // add $(KINECTSDK20_DIR)lib\x64 or x86 to the library directory for project
#endif // DLL_EXPORTS
#ifdef KCBV2_EXPORTS
#define KINECT_CB __declspec(dllexport)
#else
#define KINECT_CB __declspec(dllimport)
#pragma comment (lib, "KCBv2") // add $(KINECTSDK20_DIR)lib\x64 or x86 to the library directory for project
#endif // DLL_EXPORTS
#endif // !KCBV2_STATIC
#endif //_WIN32

#ifndef __KCB_HANDLE__
Expand Down
3 changes: 2 additions & 1 deletion KCBv2/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ See the Apache 2 License for the specific language governing permissions and lim
// dllmain.cpp : Defines the entry point for the DLL application.
#include "stdafx.h"

#ifndef KCBV2_STATIC
BOOL APIENTRY DllMain(HMODULE /* hModule */, DWORD ul_reason_for_call, LPVOID /* lpReserved */)
{
switch (ul_reason_for_call)
Expand All @@ -27,4 +28,4 @@ BOOL APIENTRY DllMain(HMODULE /* hModule */, DWORD ul_reason_for_call, LPVOID /*
}
return TRUE;
}

#endif