CMakeLists.txt 674 B

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