Skip to content

Commit abdf42a

Browse files
linesightclaude
andcommitted
Guard dpi_aware.cpp with #ifdef OS_WIN instead of CMake exclusion
Platform guards in C++ source are self-documenting and consistent with CEF's own approach; CMake one-off filename exceptions are fragile. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent d5df420 commit abdf42a

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/client_handler/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ foreach(_f IN LISTS _all_cpp)
1010
set(_skip FALSE)
1111
if(_name MATCHES "_win\\.cpp$" AND NOT WIN32)
1212
set(_skip TRUE)
13-
elseif(_name STREQUAL "dpi_aware.cpp" AND NOT WIN32)
14-
set(_skip TRUE)
1513
elseif(_name MATCHES "_linux\\.cpp$" AND NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
1614
set(_skip TRUE)
1715
elseif(_name MATCHES "_mac\\.(cpp|mm)$" AND NOT APPLE)

src/client_handler/dpi_aware.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
// Windows only
66

7+
#ifdef OS_WIN
8+
79
#pragma comment(lib, "Gdi32.lib")
810
#include <math.h>
911

@@ -227,3 +229,4 @@ void SetBrowserDpiSettings(CefRefPtr<CefBrowser> cefBrowser,
227229
);
228230
}
229231

232+
#endif // OS_WIN

0 commit comments

Comments
 (0)