MushMachine/framework/sdl_service/CMakeLists.txt

57 lines
1.1 KiB
CMake
Raw Normal View History

cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
project(sdl_service CXX)
add_library(sdl_service
src/mm/logo-f6c-square.png.h
src/mm/services/sdl_service.hpp
src/mm/services/sdl_service.cpp
)
target_include_directories(sdl_service PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/src")
target_include_directories(sdl_service PUBLIC "${SDL2_INCLUDE_DIR}")
2022-10-30 16:36:17 +01:00
target_link_libraries(sdl_service PUBLIC
entt
logger
#glm
engine
)
#if android
#target_link_libraries(sdl_service SDL)
#endif
if(EMSCRIPTEN)
2022-10-30 16:36:17 +01:00
target_compile_options(sdl_service PUBLIC -sUSE_SDL=2)
target_link_libraries(sdl_service PUBLIC -sUSE_SDL=2)
else()
#if not android or emscripten
target_include_directories(sdl_service PUBLIC "${SDL2_INCLUDE_DIR}")
2022-10-30 16:36:17 +01:00
target_link_libraries(sdl_service PUBLIC ${SDL2_LIBRARY})
#endif
endif()
if(MM_OPENGL_3_GLES)
2022-10-30 16:36:17 +01:00
target_link_libraries(sdl_service PRIVATE "GL") # TODO: make more specific
else()
2022-10-30 16:36:17 +01:00
target_link_libraries(sdl_service PRIVATE glad)
endif()
2021-11-30 19:50:40 +01:00
if(VCPKG_TARGET_TRIPLET)
2022-10-30 16:36:17 +01:00
target_link_libraries(sdl_service
PUBLIC
SDL2::SDL2
PRIVATE
SDL2::SDL2main
SDL2::SDL2-static
)
2021-11-30 19:50:40 +01:00
endif()
if(BUILD_TESTING)
add_subdirectory(test)
endif()