Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/SoftEtherVPN/libhamcore.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavide Beatrici <git@davidebeatrici.dev>2021-03-10 03:56:55 +0300
committerDavide Beatrici <git@davidebeatrici.dev>2021-03-10 03:56:55 +0300
commit8b0b250f2cb9bdeef9730c432c002acd8e6f614f (patch)
tree354cfaa6d2b3850d38c8e6e7b861c560e6b4da2a /CMakeLists.txt
parentc798511e419ededd0cbe34a09f2aaca5111d9576 (diff)
Fix errors and warnings reported by MSVC, explicitly set C99
Diffstat (limited to 'CMakeLists.txt')
-rwxr-xr-xCMakeLists.txt8
1 files changed, 8 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d508b1a..7c80405 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.11)
project(libhamcore LANGUAGES C)
+set(CMAKE_C_STANDARD 99)
+
include(TestBigEndian)
add_library(libhamcore STATIC)
@@ -11,6 +13,12 @@ if(BIG_ENDIAN)
target_compile_definitions(libhamcore PRIVATE "BYTE_ORDER_BIG_ENDIAN")
endif()
+if(MSVC)
+ # Suppress "warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead.".
+ # fopen_s() is part of C11, but we want to stick with C99 for increased portability.
+ target_compile_definitions(libhamcore PRIVATE "_CRT_SECURE_NO_WARNINGS")
+endif()
+
target_include_directories(libhamcore PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_sources(libhamcore