@@ -49,7 +49,7 @@ function(EnableCompilerFlag _flag _C _CXX _LD)
49
49
endif ()
50
50
endfunction ()
51
51
52
- macro (ADD_ZSTD_COMPILATION_FLAGS )
52
+ macro (ADD_ZSTD_COMPILATION_FLAGS _C _CXX _LD )
53
53
# We set ZSTD_HAS_NOEXECSTACK if we are certain we've set all the required
54
54
# compiler flags to mark the stack as non-executable.
55
55
set (ZSTD_HAS_NOEXECSTACK false )
@@ -63,26 +63,26 @@ macro(ADD_ZSTD_COMPILATION_FLAGS)
63
63
# EnableCompilerFlag("-std=c99" true false) # Set C compilation to c99 standard
64
64
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND MSVC )
65
65
# clang-cl normally maps -Wall to -Weverything.
66
- EnableCompilerFlag ("/clang:-Wall" true true false )
66
+ EnableCompilerFlag ("/clang:-Wall" _C _CXX false )
67
67
else ()
68
- EnableCompilerFlag ("-Wall" true true false )
68
+ EnableCompilerFlag ("-Wall" _C _CXX false )
69
69
endif ()
70
- EnableCompilerFlag ("-Wextra" true true false )
71
- EnableCompilerFlag ("-Wundef" true true false )
72
- EnableCompilerFlag ("-Wshadow" true true false )
73
- EnableCompilerFlag ("-Wcast-align" true true false )
74
- EnableCompilerFlag ("-Wcast-qual" true true false )
75
- EnableCompilerFlag ("-Wstrict-prototypes" true false false )
70
+ EnableCompilerFlag ("-Wextra" _C _CXX false )
71
+ EnableCompilerFlag ("-Wundef" _C _CXX false )
72
+ EnableCompilerFlag ("-Wshadow" _C _CXX false )
73
+ EnableCompilerFlag ("-Wcast-align" _C _CXX false )
74
+ EnableCompilerFlag ("-Wcast-qual" _C _CXX false )
75
+ EnableCompilerFlag ("-Wstrict-prototypes" _C false false )
76
76
# Enable asserts in Debug mode
77
77
if (CMAKE_BUILD_TYPE MATCHES "Debug" )
78
- EnableCompilerFlag ("-DDEBUGLEVEL=1" true true false )
78
+ EnableCompilerFlag ("-DDEBUGLEVEL=1" _C _CXX false )
79
79
endif ()
80
80
# Add noexecstack flags
81
81
# LDFLAGS
82
- EnableCompilerFlag ("-Wl,-z,noexecstack" false false true )
82
+ EnableCompilerFlag ("-Wl,-z,noexecstack" false false _LD )
83
83
# CFLAGS & CXXFLAGS
84
- EnableCompilerFlag ("-Qunused-arguments" true true false )
85
- EnableCompilerFlag ("-Wa,--noexecstack" true true false )
84
+ EnableCompilerFlag ("-Qunused-arguments" _C _CXX false )
85
+ EnableCompilerFlag ("-Wa,--noexecstack" _C _CXX false )
86
86
# NOTE: Using 3 nested ifs because the variables are sometimes
87
87
# empty if the condition is false, and sometimes equal to false.
88
88
# This implicitly converts them to truthy values. There may be
@@ -99,15 +99,15 @@ macro(ADD_ZSTD_COMPILATION_FLAGS)
99
99
100
100
set (ACTIVATE_MULTITHREADED_COMPILATION "ON" CACHE BOOL "activate multi-threaded compilation (/MP flag)" )
101
101
if (CMAKE_GENERATOR MATCHES "Visual Studio" AND ACTIVATE_MULTITHREADED_COMPILATION )
102
- EnableCompilerFlag ("/MP" true true false )
102
+ EnableCompilerFlag ("/MP" _C _CXX false )
103
103
endif ()
104
104
105
105
# UNICODE SUPPORT
106
- EnableCompilerFlag ("/D_UNICODE" true true false )
107
- EnableCompilerFlag ("/DUNICODE" true true false )
106
+ EnableCompilerFlag ("/D_UNICODE" _C _CXX false )
107
+ EnableCompilerFlag ("/DUNICODE" _C _CXX false )
108
108
# Enable asserts in Debug mode
109
109
if (CMAKE_BUILD_TYPE MATCHES "Debug" )
110
- EnableCompilerFlag ("/DDEBUGLEVEL=1" true true false )
110
+ EnableCompilerFlag ("/DDEBUGLEVEL=1" _C _CXX false )
111
111
endif ()
112
112
endif ()
113
113
0 commit comments