Skip to content
Merged
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
10 changes: 8 additions & 2 deletions Client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ if (LINUX)
endif ()

if (WIN32)
ADD_DEFINITIONS(-DUNICODE)
target_compile_definitions(SonyHeadphonesClient PRIVATE
UNICODE _UNICODE
NOMINMAX
WIN32_LEAN_AND_MEAN)

target_sources(SonyHeadphonesClient
PRIVATE windows/WindowsGUI.cpp
Expand All @@ -94,8 +97,11 @@ if (WIN32)
imgui/backends/imgui_impl_win32.cpp
)

# Non-MSVC toolchains have no #pragma comment(lib, ...), so name every import library here.
target_link_libraries(SonyHeadphonesClient
PRIVATE d3d11
PRIVATE d3d11 dxgi d3dcompiler
ws2_32 rpcrt4 bthprops
dwmapi # imgui_impl_win32.cpp
)
endif ()

Expand Down
24 changes: 16 additions & 8 deletions Client/windows/WindowsBluetoothConnector.h
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
#pragma once
#include <stdio.h>
#pragma comment(lib, "ws2_32.lib")
#pragma comment(lib, "rpcrt4.lib")
#pragma comment(lib, "Bthprops.lib")

// winsock2.h must precede windows.h, which bluetoothapis.h pulls in.
#include <winsock2.h>
#include <ws2bth.h>
#include <BluetoothAPIs.h>
#include <iostream>
// Lowercase: the MinGW-w64 headers are named this way, and so is the file on a
// case-sensitive filesystem (cross-compiling from Linux).
#include <bluetoothapis.h>
#include <rpc.h>
#include "IBluetoothConnector.h"

#include <atomic>
#include <string>

#include "IBluetoothConnector.h"
#include "ByteMagic.h"
#include <atomic>

// Only MSVC understands these; every other toolchain gets the libraries from CMake.
#ifdef _MSC_VER
#pragma comment(lib, "ws2_32.lib")
#pragma comment(lib, "rpcrt4.lib")
#pragma comment(lib, "bthprops.lib")
#endif

class WindowsBluetoothConnector final : public IBluetoothConnector
{
Expand Down
2 changes: 1 addition & 1 deletion Client/windows/WindowsGUI.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include <string>

#include "Windows.h"
#include <windows.h>

#include "CrossPlatformGUI.h"

Expand Down
1 change: 1 addition & 0 deletions Client/windows/main.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <stdio.h>
#include <iostream>
#include <memory>
#include "WindowsBluetoothConnector.h"
#include "CommandSerializer.h"
Expand Down