CMakeLists.txt 750 B

123456789101112131415161718192021222324252627282930313233343536
  1. cmake_minimum_required(VERSION 3.0)
  2. project(enet C)
  3. if (ENET_STATIC)
  4. add_library(enet STATIC test/library.c)
  5. if (WIN32)
  6. target_link_libraries(enet PUBLIC winmm ws2_32)
  7. endif()
  8. endif()
  9. if (ENET_SHARED)
  10. add_definitions(-DENET_DLL)
  11. add_library(enet SHARED test/library.c)
  12. if (WIN32)
  13. target_link_libraries(enet PUBLIC winmm ws2_32)
  14. endif()
  15. endif()
  16. if (ENET_TEST)
  17. add_executable(enet_test test/build.c)
  18. if (WIN32)
  19. target_link_libraries(enet_test PUBLIC winmm ws2_32)
  20. endif()
  21. endif()
  22. if(MSVC)
  23. target_compile_definitions(enet PRIVATE -W3)
  24. else()
  25. target_compile_definitions(enet PRIVATE -Wno-error)
  26. endif()
  27. target_include_directories(enet PUBLIC ${PROJECT_SOURCE_DIR}/include)