Skip to content

Commit a05b724

Browse files
committed
Refactoring & update osx compiler options
Signed-off-by: Stavros Avramidis <[email protected]>
1 parent ea105c8 commit a05b724

File tree

4 files changed

+26
-23
lines changed

4 files changed

+26
-23
lines changed

.github/workflows/ccpp.yml

-19
This file was deleted.

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.idea/
12
.vscode
23
CMakeLists.txt
34
CMakeCache.txt
@@ -8,3 +9,7 @@ qrc_resources.cpp
89
resources.qrc.depends
910
tidal-rpc.app/
1011
tidal-rpc_autogen/
12+
/.vs/
13+
/cmake-build-*/
14+
/tidal-rpc.pro.user
15+
/.idea/

CMakeLists.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ if (WIN32)
6363
if (MSVC)
6464
STRING(REPLACE "/Od" "/O2" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
6565
else ()
66-
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -ffast-math")
66+
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -ffast-math")
6767
endif ()
6868

6969

@@ -92,6 +92,7 @@ elseif (APPLE)
9292
include_directories(discord-rpc/osx-static/include)
9393
target_link_libraries(tidal-rpc ${CMAKE_BINARY_DIR}/discord-rpc/osx-static/lib/libdiscord-rpc.a)
9494
set(CMAKE_CXX_FLAGS "-framework carbon -framework foundation -framework CoreFoundation")
95+
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -fast-math")
9596
set(MACOSX_BUNDLE_BUNDLE_NAME rpc.tidal)
9697
set(MACOSX_BUNDLE_EXECUTABLE_NAME tidal-rpc)
9798
set(MACOSX_BUNDLE_INFO_STRING rpc.tidal)

osx_api_hook.hh

+19-3
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,28 @@ std::wstring ctow(const char *src) {
4040
return std::wstring(&dest[0]);
4141
}
4242

43-
bool macPerms(){
44-
CGDisplayStreamRef stream = CGDisplayStreamCreate(CGMainDisplayID(), 1, 1, 'BGRA', nil, ^(CGDisplayStreamFrameStatus status, uint64_t displayTime, IOSurfaceRef frameSurface, CGDisplayStreamUpdateRef updateRef) {});
43+
44+
/**
45+
* Attempting to get a Stream of the screen triggering the Screen Recording Permission window on macOS Catalina
46+
* @return Bool showing presence of permissions for screen recording
47+
*/
48+
bool macPerms() {
49+
CGDisplayStreamRef stream = CGDisplayStreamCreate(
50+
CGMainDisplayID(),
51+
1,
52+
1,
53+
'BGRA',
54+
nil,
55+
^(CGDisplayStreamFrameStatus status,
56+
uint64_t displayTime,
57+
IOSurfaceRef frameSurface,
58+
CGDisplayStreamUpdateRef updateRef) {}
59+
);
60+
4561
if (stream) {
4662
CFRelease(stream);
4763
return true;
48-
}else{
64+
} else {
4965
return false;
5066
}
5167
}

0 commit comments

Comments
 (0)