removed explicit compilation standard from cmake script

it's not expected to be useful
and can actually lead to subtle side effects
such as #3163.
This commit is contained in:
Yann Collet 2022-06-19 14:52:32 -07:00
parent f15dd6420c
commit eceecc5b2c

View File

@ -22,10 +22,12 @@ endfunction()
macro(ADD_ZSTD_COMPILATION_FLAGS) macro(ADD_ZSTD_COMPILATION_FLAGS)
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang" OR MINGW) #Not only UNIX but also WIN32 for MinGW if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang" OR MINGW) #Not only UNIX but also WIN32 for MinGW
#Set c++11 by default # It's possible to select the exact standard used for compilation.
EnableCompilerFlag("-std=c++11" false true) # It's not necessary, but can be employed for specific purposes.
#Set c99 by default # Note that zstd source code is compatible with both C++98 and above
EnableCompilerFlag("-std=c99" true false) # and C-gnu90 (c90 + long long + variadic macros ) and above
# EnableCompilerFlag("-std=c++11" false true) # Set C++ compilation to c++11 standard
# EnableCompilerFlag("-std=c99" true false) # Set C compiation to c99 standard
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND MSVC) if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND MSVC)
# clang-cl normally maps -Wall to -Weverything. # clang-cl normally maps -Wall to -Weverything.
EnableCompilerFlag("/clang:-Wall" true true) EnableCompilerFlag("/clang:-Wall" true true)
@ -48,7 +50,7 @@ macro(ADD_ZSTD_COMPILATION_FLAGS)
if (CMAKE_GENERATOR MATCHES "Visual Studio" AND ACTIVATE_MULTITHREADED_COMPILATION) if (CMAKE_GENERATOR MATCHES "Visual Studio" AND ACTIVATE_MULTITHREADED_COMPILATION)
EnableCompilerFlag("/MP" true true) EnableCompilerFlag("/MP" true true)
endif () endif ()
# UNICODE SUPPORT # UNICODE SUPPORT
EnableCompilerFlag("/D_UNICODE" true true) EnableCompilerFlag("/D_UNICODE" true true)
EnableCompilerFlag("/DUNICODE" true true) EnableCompilerFlag("/DUNICODE" true true)