diff --git a/CMakeLists.txt b/CMakeLists.txt index fd6ed899..081dabb1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -116,6 +116,9 @@ ADD_SUBDIRECTORY("src") ADD_SUBDIRECTORY("lib/xgraph") ADD_SUBDIRECTORY("lib/xsound") ADD_SUBDIRECTORY("lib/xtool") -ADD_SUBDIRECTORY("lib/utils") -ADD_SUBDIRECTORY("server") -ADD_SUBDIRECTORY("surmap") + +if(NOT ANDROID) + ADD_SUBDIRECTORY("lib/utils") + ADD_SUBDIRECTORY("server") + ADD_SUBDIRECTORY("surmap") +endif() diff --git a/lib/xgraph/CMakeLists.txt b/lib/xgraph/CMakeLists.txt index fb76a676..d49df692 100644 --- a/lib/xgraph/CMakeLists.txt +++ b/lib/xgraph/CMakeLists.txt @@ -9,8 +9,10 @@ SET(xgraph_SRCS xside.cpp ) -ADD_LIBRARY(xgraph STATIC ${xgraph_SRCS}) +if (ANDROID) + ADD_LIBRARY(xgraph OBJECT ${xgraph_SRCS}) +else() + ADD_LIBRARY(xgraph STATIC ${xgraph_SRCS}) + TARGET_LINK_LIBRARIES(xgraph ${SDL2_LIBRARY}) +endif() -TARGET_LINK_LIBRARIES(xgraph - ${SDL2_LIBRARY} -) diff --git a/lib/xsound/CMakeLists.txt b/lib/xsound/CMakeLists.txt index a75b4cd9..e3314055 100644 --- a/lib/xsound/CMakeLists.txt +++ b/lib/xsound/CMakeLists.txt @@ -9,12 +9,16 @@ SET(xsound_SRCS ogg_stream.cpp ) -ADD_LIBRARY(xsound STATIC ${xsound_SRCS}) -TARGET_LINK_LIBRARIES(xsound - ${CLUNK_LIBRARY} - ${FFMPEG_LIBRARIES} - ${OGG_LIBRARY} - ${VORBIS_LIBRARY} - ${VORBISFILE_LIBRARY} -) +if (ANDROID) + ADD_LIBRARY(xsound OBJECT ${xsound_SRCS}) +else() + ADD_LIBRARY(xsound STATIC ${xsound_SRCS}) + TARGET_LINK_LIBRARIES(xsound + ${CLUNK_LIBRARY} + ${FFMPEG_LIBRARIES} + ${OGG_LIBRARY} + ${VORBIS_LIBRARY} + ${VORBISFILE_LIBRARY} + ) +endif() diff --git a/lib/xtool/CMakeLists.txt b/lib/xtool/CMakeLists.txt index 40e4be16..b8dd60b7 100644 --- a/lib/xtool/CMakeLists.txt +++ b/lib/xtool/CMakeLists.txt @@ -29,8 +29,11 @@ ENDIF(DXSTREAM_DEBUG) INCLUDE_DIRECTORIES(BEFORE .) -ADD_LIBRARY(xtool STATIC ${xtool_SRCS}) +if (ANDROID) + ADD_LIBRARY(xtool OBJECT ${xtool_SRCS}) +else() + ADD_LIBRARY(xtool STATIC ${xtool_SRCS}) + TARGET_LINK_LIBRARIES(xtool ${WIN_DBG}) +endif() -TARGET_COMPILE_DEFINITIONS (xtool PUBLIC "-DGIT_COMMIT_HASH=\"${GIT_COMMIT_HASH}\"" "-DGIT_BRANCH=\"${GIT_BRANCH}\"" "-DGITHUB_COMMIT_HASH=\"$ENV{GITHUB_SHA}\"" "-DGITHUB_BRANCH=\"$ENV{GITHUB_REF_NAME}\"") - -TARGET_LINK_LIBRARIES(xtool ${WIN_DBG}) \ No newline at end of file +TARGET_COMPILE_DEFINITIONS (xtool PUBLIC "-DGIT_COMMIT_HASH=\"${GIT_COMMIT_HASH}\"" "-DGIT_BRANCH=\"${GIT_BRANCH}\"" "-DGITHUB_COMMIT_HASH=\"$ENV{GITHUB_SHA}\"" "-DGITHUB_BRANCH=\"$ENV{GITHUB_REF_NAME}\"") \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 67020264..8066760c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -72,29 +72,37 @@ SET(vangers_SRCS ${WINDOWS_RES} actint/layout.h) -ADD_EXECUTABLE(vangers ${vangers_SRCS}) - -IF(WIN32) - SET(WIN_LIB - wsock32 - #-mwindows - #-Wl,-subsystem,windows +if (ANDROID) + ADD_LIBRARY(vangers STATIC ${vangers_SRCS} + $ + $ + $ ) -ENDIF(WIN32) +else() + ADD_EXECUTABLE(vangers ${vangers_SRCS}) -TARGET_LINK_LIBRARIES(vangers - ${SDL2_LIBRARY} - ${OGG_LIBRARY} - ${VORBIS_LIBRARY} - ${VORBISFILE_LIBRARY} - ${CLUNK_LIBRARY} - ${SDL2_NET_LIBRARY} - ${FFMPEG_LIBRARIES} - ${ZLIB_LIBRARIES} - ${OPENGL_LIBRARIES} - ${WIN_LIB} - ${STEAM_LIBS} - xtool - xgraph - xsound -) + IF(WIN32) + SET(WIN_LIB + wsock32 + #-mwindows + #-Wl,-subsystem,windows + ) + ENDIF(WIN32) + + TARGET_LINK_LIBRARIES(vangers + ${SDL2_LIBRARY} + ${OGG_LIBRARY} + ${VORBIS_LIBRARY} + ${VORBISFILE_LIBRARY} + ${CLUNK_LIBRARY} + ${SDL2_NET_LIBRARY} + ${FFMPEG_LIBRARIES} + ${ZLIB_LIBRARIES} + ${OPENGL_LIBRARIES} + ${WIN_LIB} + ${STEAM_LIBS} + xtool + xgraph + xsound + ) +endif(ANDROID) \ No newline at end of file