@@ -18,41 +18,39 @@ set(LIBNATIVEAPI_INCLUDE_DIR "${LIBNATIVEAPI_ROOT}/include")
1818file (GLOB COMMON_SOURCES "${LIBNATIVEAPI_SRC_DIR} /*.cpp" "${LIBNATIVEAPI_SRC_DIR} /foundation/*.cpp" )
1919list (FILTER COMMON_SOURCES EXCLUDE REGEX "${LIBNATIVEAPI_SRC_DIR} /platform/*" )
2020
21- # Foundation source files
22- file (GLOB FOUNDATION_SOURCES "${LIBNATIVEAPI_SRC_DIR} /foundation/*.cpp" )
23-
2421# C API source files
2522file (GLOB CAPI_SOURCES
2623 "${LIBNATIVEAPI_SRC_DIR} /capi/*.cpp"
2724 "${LIBNATIVEAPI_SRC_DIR} /capi/*.c"
2825)
2926
3027# Platform-specific source files
31- if (CMAKE_SYSTEM_NAME STREQUAL "Linux" )
28+ if (ANDROID )
29+ file (GLOB PLATFORM_SOURCES "${LIBNATIVEAPI_SRC_DIR} /platform/android/*.cpp" )
30+ elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux" )
3231 file (GLOB PLATFORM_SOURCES "${LIBNATIVEAPI_SRC_DIR} /platform/linux/*.cpp" )
3332 # Find packages for Linux
3433 find_package (PkgConfig REQUIRED )
3534 pkg_check_modules (GTK REQUIRED IMPORTED_TARGET gtk+-3.0 )
3635 pkg_check_modules (X11 REQUIRED IMPORTED_TARGET x11 )
3736 pkg_check_modules (XI REQUIRED IMPORTED_TARGET xi )
3837 pkg_check_modules (AYATANA_APPINDICATOR REQUIRED IMPORTED_TARGET ayatana-appindicator3-0.1 )
39- elseif (WIN32 )
40- file (GLOB PLATFORM_SOURCES "${LIBNATIVEAPI_SRC_DIR} /platform/windows/*.cpp" )
4138elseif (APPLE )
4239 file (GLOB PLATFORM_SOURCES "${LIBNATIVEAPI_SRC_DIR} /platform/macos/*.mm" )
4340 # Find required frameworks for macOS
4441 find_library (COCOA_FRAMEWORK Cocoa )
4542 find_library (CARBON_FRAMEWORK Carbon )
4643 find_library (COREGRAPHICS_FRAMEWORK CoreGraphics )
4744 find_library (APPLICATIONSERVICES_FRAMEWORK ApplicationServices )
45+ elseif (WIN32 )
46+ file (GLOB PLATFORM_SOURCES "${LIBNATIVEAPI_SRC_DIR} /platform/windows/*.cpp" )
4847else ()
4948 set (PLATFORM_SOURCES "" )
5049endif ()
5150
5251# Add library target
5352add_library (cnativeapi SHARED
5453 ${COMMON_SOURCES}
55- ${FOUNDATION_SOURCES}
5654 ${PLATFORM_SOURCES}
5755 ${CAPI_SOURCES}
5856)
@@ -73,7 +71,9 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
7371endif ()
7472
7573# Link required frameworks and libraries
76- if (CMAKE_SYSTEM_NAME STREQUAL "Linux" )
74+ if (ANDROID )
75+ target_link_libraries (cnativeapi PUBLIC log android )
76+ elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux" )
7777 target_link_libraries (cnativeapi PUBLIC
7878 PkgConfig::GTK
7979 PkgConfig::X11
0 commit comments