Skip to content

Commit 854436d

Browse files
committed
Update platform sources and Windows libraries in CMake
Expanded platform source file glob patterns to include all .cpp/.mm files for Linux, Windows, and macOS. Added 'gdiplus' and 'crypt32' to Windows target link libraries for broader API support.
1 parent 8a53d95 commit 854436d

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

packages/cnativeapi/src/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,17 @@ file(GLOB CAPI_SOURCES
2929

3030
# Platform-specific source files
3131
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
32-
file(GLOB PLATFORM_SOURCES "${LIBNATIVEAPI_SRC_DIR}/platform/linux/*_linux.cpp")
32+
file(GLOB PLATFORM_SOURCES "${LIBNATIVEAPI_SRC_DIR}/platform/linux/*.cpp")
3333
# Find packages for Linux
3434
find_package(PkgConfig REQUIRED)
3535
pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)
3636
pkg_check_modules(X11 REQUIRED IMPORTED_TARGET x11)
3737
pkg_check_modules(XI REQUIRED IMPORTED_TARGET xi)
3838
pkg_check_modules(AYATANA_APPINDICATOR REQUIRED IMPORTED_TARGET ayatana-appindicator3-0.1)
3939
elseif (WIN32)
40-
file(GLOB PLATFORM_SOURCES "${LIBNATIVEAPI_SRC_DIR}/platform/windows/*_windows.cpp")
40+
file(GLOB PLATFORM_SOURCES "${LIBNATIVEAPI_SRC_DIR}/platform/windows/*.cpp")
4141
elseif (APPLE)
42-
file(GLOB PLATFORM_SOURCES "${LIBNATIVEAPI_SRC_DIR}/platform/macos/*_macos.mm")
42+
file(GLOB PLATFORM_SOURCES "${LIBNATIVEAPI_SRC_DIR}/platform/macos/*.mm")
4343
# Find required frameworks for macOS
4444
find_library(COCOA_FRAMEWORK Cocoa)
4545
find_library(CARBON_FRAMEWORK Carbon)
@@ -82,7 +82,7 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
8282
pthread
8383
)
8484
elseif (WIN32)
85-
target_link_libraries(cnativeapi PUBLIC user32 shell32 dwmapi)
85+
target_link_libraries(cnativeapi PUBLIC user32 shell32 dwmapi gdiplus crypt32)
8686
endif ()
8787

8888
target_compile_definitions(cnativeapi PUBLIC DART_SHARED_LIB)

0 commit comments

Comments
 (0)