@@ -21,6 +21,33 @@ option(YASIO_BUILD_TESTS "Build yasio tests and examples" ON)
2121option (YASIO_BUILD_LUA_EXAMPLE "Build yasio lua example" ON )
2222option (YAISO_BUILD_NI "Build yasio with native interface for interop" OFF )
2323
24+
25+ # --- The C/C++ standard
26+ if (NOT MSVC )
27+ if (NOT CXX_STD)
28+ set (CXX_STD 11)
29+ endif ()
30+ set (CMAKE_CXX_STANDARD ${CXX_STD} )
31+ else ()
32+ if (CXX_STD)
33+ set (CMAKE_CXX_STANDARD ${CXX_STD} )
34+ else ()
35+ include (CheckCXXCompilerFlag )
36+ check_cxx_compiler_flag ("/std:c++latest" YASIO_HAVE_CXX_LATEST )
37+ if (YASIO_HAVE_CXX_LATEST)
38+ set (CXX_STD latest)
39+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS } /std:c++latest" )
40+ else ()
41+ set (CXX_STD 11)
42+ endif ()
43+ endif ()
44+ endif ()
45+
46+ set (CMAKE_C_STANDARD 99)
47+ set (CMAKE_C_STANDARD_REQUIRED ON )
48+
49+ message (STATUS "Building yasio with C++${CXX_STD} support" )
50+
2451function (yasio_config_target_outdir target )
2552 set_target_properties (${target} PROPERTIES
2653 ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR } "
@@ -60,23 +87,6 @@ if (NOT DEFINED YASIO_HAVE_HALF_FLOAT)
6087 set (YASIO_HAVE_HALF_FLOAT ON )
6188endif ()
6289
63- # --- The C++ standard
64- if (NOT MSVC )
65- if (NOT CXX_STD)
66- set (CXX_STD 11)
67- endif ()
68- set (CMAKE_CXX_STANDARD ${CXX_STD} )
69- else ()
70- if (CXX_STD)
71- set (CMAKE_CXX_STANDARD ${CXX_STD} )
72- else ()
73- set (CXX_STD latest)
74- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS } /std:c++latest" )
75- endif ()
76- endif ()
77-
78- message (STATUS "Building yasio with C++${CXX_STD} support" )
79-
8090# The compiler flags
8191if (BUILD_SHARED_LIBS AND LINUX )
8292 set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS } -Wall -fPIC" )
@@ -129,7 +139,7 @@ if (YASIO_HAVE_CARES)
129139endif ()
130140
131141### The yasio core library project
132- file (GLOB_RECURSE YASIO_CORE yasio/detail/*.hpp )
142+ file (GLOB_RECURSE YASIO_CORE yasio/detail/*.hpp;yasio/detail/*.inl )
133143list (APPEND YASIO_CORE
134144 yasio/compiler/feature_test.hpp
135145 yasio/cxx17/memory.hpp
@@ -310,9 +320,8 @@ macro(yasio_config_app_depends target_name)
310320endmacro ()
311321
312322# checking build system have openssl
313- if (OPENSSL_INCLUDE_DIR)
314- set (YASIO_SSL_BACKEND 1)
315- target_include_directories (${yasio_target_name} PRIVATE "${OPENSSL_INCLUDE_DIR} " )
323+ if (OPENSSL_INCLUDE_DIR AND (YASIO_SSL_BACKEND EQUAL 1))
324+ target_include_directories (${yasio_target_name} PRIVATE "${OPENSSL_INCLUDE_DIR} " )
316325endif ()
317326
318327# checking build system have c-ares
0 commit comments