Skip to content

Commit b77bc46

Browse files
authored
Merge pull request #169 from CesarBerriot/master
Ported screen_capture_lite to MinGW-w64 and Clang on Windows.
2 parents 1170d57 + 1ec7a7c commit b77bc46

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

include/ScreenCapture.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#pragma once
22

3-
#if defined(WINDOWS) || defined(WIN32)
3+
#if defined(WINDOWS) || defined(WIN32) || defined(__MINGW32__)
44
#if defined(SC_LITE_DLL)
55
#define SC_LITE_EXTERN __declspec(dllexport)
66
#else

include/ScreenCapture_C_API.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#ifndef SCREEN_CAPTURE_LITE_BUILD_SCREENCAPTURE_C_API_H
66
#define SCREEN_CAPTURE_LITE_BUILD_SCREENCAPTURE_C_API_H
77

8-
#if defined(WINDOWS) || defined(WIN32)
8+
#if defined(WINDOWS) || defined(WIN32) || defined(__MINGW32__)
99
#if defined(SC_LITE_DLL) && defined(__cplusplus)
1010
#define SC_LITE_C_EXTERN extern "C" __declspec(dllexport)
1111
#else

include/windows/DXFrameProcessor.h

-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
#include <d3d11.h>
88
#include <dxgi1_2.h>
99

10-
#pragma comment(lib, "dxgi.lib")
11-
#pragma comment(lib, "d3d11.lib")
12-
1310
namespace SL {
1411
namespace Screen_Capture {
1512
class DXFrameProcessor : public BaseFrameProcessor {

src_cpp/CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ if(WIN32)
1717
../include/windows
1818
)
1919
add_definitions(-DNOMINMAX)
20+
link_libraries(dxgi.lib d3d11.lib)
2021
elseif(APPLE)
2122

2223
set(SCREEN_CAPTURE_PLATFORM_SRC
@@ -80,12 +81,13 @@ set(libsrc
8081
if(NOT ${BUILD_SHARED_LIBS})
8182
message("Building STATIC Library")
8283
add_library(${PROJECT_NAME}_static STATIC ${libsrc})
84+
target_link_libraries(${PROJECT_NAME}_static Dwmapi)
8385
else()
8486
message("Building SHARED Library")
8587

8688
add_library(${PROJECT_NAME}_shared SHARED ${libsrc} ../include/ScreenCapture_C_API.h)
8789

88-
set_target_properties(${PROJECT_NAME}_shared PROPERTIES DEFINE_SYMBOL SC_LITE_DLL)
90+
add_definitions(-DSC_LITE_DLL)
8991
if(WIN32)
9092
target_link_libraries(${PROJECT_NAME}_shared Dwmapi)
9193
if (!MINGW)

src_cpp/windows/GDIFrameProcessor.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#include "GDIFrameProcessor.h"
22
#include <Dwmapi.h>
33

4+
#ifndef PW_RENDERFULLCONTENT
5+
#define PW_RENDERFULLCONTENT 2
6+
#endif
7+
48
namespace SL {
59
namespace Screen_Capture {
610

0 commit comments

Comments
 (0)