@@ -22,24 +22,24 @@ list(FILTER COMMON_SOURCES EXCLUDE REGEX "platform/*")
2222file (GLOB CAPI_SOURCES "capi/*.cpp" "capi/*.c" )
2323
2424# Platform-specific source files
25- if (CMAKE_SYSTEM_NAME STREQUAL "Linux" )
25+ if (ANDROID)
26+ file (GLOB PLATFORM_SOURCES "platform/android/*.cpp" )
27+ elseif (CMAKE_SYSTEM_NAME STREQUAL "iOS" )
28+ file (GLOB PLATFORM_SOURCES "platform/ios/*.mm" )
29+ elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux" )
2630 file (GLOB PLATFORM_SOURCES "platform/linux/*.cpp" )
2731 # Find packages for Linux
2832 find_package (PkgConfig REQUIRED)
2933 pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)
3034 pkg_check_modules(X11 REQUIRED IMPORTED_TARGET x11)
3135 pkg_check_modules(XI REQUIRED IMPORTED_TARGET xi)
3236 pkg_check_modules(AYATANA_APPINDICATOR REQUIRED IMPORTED_TARGET ayatana-appindicator3-0.1)
33- elseif (CMAKE_SYSTEM_NAME STREQUAL "iOS" )
34- file (GLOB PLATFORM_SOURCES "platform/ios/*.mm" )
3537elseif (APPLE )
3638 file (GLOB PLATFORM_SOURCES "platform/macos/*.mm" )
37- elseif (WIN32 )
38- file (GLOB PLATFORM_SOURCES "platform/windows/*.cpp" )
39- elseif (ANDROID)
40- file (GLOB PLATFORM_SOURCES "platform/android/*.cpp" )
4139elseif (CMAKE_SYSTEM_NAME STREQUAL "OHOS" )
4240 file (GLOB PLATFORM_SOURCES "platform/ohos/*.cpp" )
41+ elseif (WIN32 )
42+ file (GLOB PLATFORM_SOURCES "platform/windows/*.cpp" )
4343else ()
4444 set (PLATFORM_SOURCES "" )
4545endif ()
@@ -67,18 +67,18 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
6767endif ()
6868
6969# Link required frameworks and libraries
70- if (CMAKE_SYSTEM_NAME STREQUAL "iOS" )
70+ if (ANDROID)
71+ target_link_libraries (nativeapi PUBLIC log android)
72+ elseif (CMAKE_SYSTEM_NAME STREQUAL "iOS" )
7173 target_link_libraries (nativeapi PUBLIC "-framework UIKit" "-framework Foundation" "-framework CoreGraphics" )
7274 target_compile_options (nativeapi PRIVATE "-x" "objective-c++" )
75+ elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux" )
76+ target_link_libraries (nativeapi PUBLIC PkgConfig::GTK PkgConfig::X11 PkgConfig::XI PkgConfig::AYATANA_APPINDICATOR pthread)
7377elseif (APPLE )
7478 target_link_libraries (nativeapi PUBLIC "-framework Cocoa" )
7579 target_compile_options (nativeapi PRIVATE "-x" "objective-c++" )
76- elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux" )
77- target_link_libraries (nativeapi PUBLIC PkgConfig::GTK PkgConfig::X11 PkgConfig::XI PkgConfig::AYATANA_APPINDICATOR pthread)
78- elseif (WIN32 )
79- target_link_libraries (nativeapi PUBLIC user32 shell32 dwmapi gdiplus crypt32)
80- elseif (ANDROID)
81- target_link_libraries (nativeapi PUBLIC log android)
8280elseif (CMAKE_SYSTEM_NAME STREQUAL "OHOS" )
8381 target_link_libraries (nativeapi PUBLIC hilog_ndk.z)
82+ elseif (WIN32 )
83+ target_link_libraries (nativeapi PUBLIC user32 shell32 dwmapi gdiplus crypt32)
8484endif ()
0 commit comments