SDL_ttf.patch 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. diff --git a/CMakeLists.txt b/CMakeLists.txt
  2. index f4e6f41..2dff726 100644
  3. --- a/CMakeLists.txt
  4. +++ b/CMakeLists.txt
  5. @@ -3,20 +3,28 @@
  6. cmake_minimum_required(VERSION 3.0)
  7. project(SDL2_TTF C)
  8. -find_path(SDL_INCLUDE_DIR SDL2/SDL.h)
  9. -find_library(SDL_LIBRARY NAMES SDL2d SDL2)
  10. -find_package(Freetype REQUIRED)
  11. +if(NOT EMSCRIPTEN)
  12. + find_path(SDL_INCLUDE_DIR SDL2/SDL.h)
  13. + find_library(SDL_LIBRARY NAMES SDL2d SDL2)
  14. + find_package(Freetype REQUIRED)
  15. +endif(NOT EMSCRIPTEN)
  16. add_library(SDL2_ttf SDL_ttf.c version.rc)
  17. set_target_properties(SDL2_ttf PROPERTIES DEFINE_SYMBOL SDL2_EXPORTS)
  18. -target_include_directories(SDL2_ttf PRIVATE ${SDL_INCLUDE_DIR}/SDL2 ${FREETYPE_INCLUDE_DIR_ft2build})
  19. +if(NOT EMSCRIPTEN)
  20. + target_include_directories(SDL2_ttf PRIVATE ${SDL_INCLUDE_DIR}/SDL2 ${FREETYPE_INCLUDE_DIR_ft2build})
  21. +endif(NOT EMSCRIPTEN)
  22. if(WITH_RAQM)
  23. add_definitions(-DHAVE_RAQM=1)
  24. target_include_directories(SDL2_ttf PRIVATE ${RAQM_INCLUDE_DIR})
  25. target_link_libraries(SDL2_ttf PUBLIC ${RAQM_LIBRARIES})
  26. endif()
  27. -target_link_libraries(SDL2_ttf PRIVATE ${SDL_LIBRARY} ${FREETYPE_LIBRARY})
  28. +if(EMSCRIPTEN)
  29. + target_link_libraries(SDL2_ttf PUBLIC ${SDL2_LIBRARIES} ${FREETYPE_LIBRARY})
  30. +else(EMSCRIPTEN)
  31. + target_link_libraries(SDL2_ttf PRIVATE ${SDL_LIBRARY} ${FREETYPE_LIBRARY})
  32. +endif(EMSCRIPTEN)
  33. install(TARGETS SDL2_ttf
  34. RUNTIME DESTINATION bin