Browse Source

updated cmake w proper switch vals

c6burns 6 years ago
parent
commit
0347bce9ae
1 changed files with 7 additions and 5 deletions
  1. 7 5
      Source/Native/CMakeLists.txt

+ 7 - 5
Source/Native/CMakeLists.txt

@@ -1,10 +1,10 @@
-cmake_minimum_required(VERSION 2.6)
+cmake_minimum_required(VERSION 3.1)
 project(enet C)
 project(enet C)
 
 
-set(ENET_DEBUG "0" CACHE BOOL "Enable debug functionality")
-set(ENET_STATIC "0" CACHE BOOL "Create a static library")
-set(ENET_SHARED "0" CACHE BOOL "Create a shared library")
-set(ENET_LZ4 "0" CACHE BOOL "Add support for an optional packet-level compression")
+set(ENET_DEBUG OFF CACHE BOOL "Enable debug functionality")
+set(ENET_STATIC OFF CACHE BOOL "Create a static library")
+set(ENET_SHARED OFF CACHE BOOL "Create a shared library")
+set(ENET_LZ4 OFF CACHE BOOL "Add support for an optional packet-level compression")
 
 
 if (ENET_DEBUG)
 if (ENET_DEBUG)
     add_definitions(-DENET_DEBUG)
     add_definitions(-DENET_DEBUG)
@@ -20,6 +20,7 @@ if (ENET_STATIC)
 
 
     if (WIN32)
     if (WIN32)
         target_link_libraries(enet_static winmm ws2_32)
         target_link_libraries(enet_static winmm ws2_32)
+		target_compile_definitions(enet PRIVATE _CRT_SECURE_NO_WARNINGS)
         SET_TARGET_PROPERTIES(enet_static PROPERTIES PREFIX "")
         SET_TARGET_PROPERTIES(enet_static PROPERTIES PREFIX "")
     endif()
     endif()
 endif()
 endif()
@@ -30,6 +31,7 @@ if (ENET_SHARED)
 
 
     if (WIN32)
     if (WIN32)
         target_link_libraries(enet winmm ws2_32)
         target_link_libraries(enet winmm ws2_32)
+		target_compile_definitions(enet PRIVATE _CRT_SECURE_NO_WARNINGS)
         SET_TARGET_PROPERTIES(enet PROPERTIES PREFIX "")
         SET_TARGET_PROPERTIES(enet PROPERTIES PREFIX "")
     endif()
     endif()
 endif()
 endif()