diff options
author | kinichiro <kinichiro.inoguchi@gmail.com> | 2016-10-06 11:30:55 +0900 |
---|---|---|
committer | Brent Cook <bcook@openbsd.org> | 2016-10-30 21:40:21 -0500 |
commit | b434123987dc08fd47bd988bd3fe09277445001d (patch) | |
tree | 9e3fdbca9249a27851f622b479d77479e7fe68ef /CMakeLists.txt | |
parent | 62f2a73061eda53f5d60cfa7fab7dfb6bd7803ad (diff) | |
download | portable-b434123987dc08fd47bd988bd3fe09277445001d.tar.gz portable-b434123987dc08fd47bd988bd3fe09277445001d.tar.bz2 portable-b434123987dc08fd47bd988bd3fe09277445001d.zip |
modify for Intel C++ Compiler
- define _CRT_SUPPRESS_RESTRICT to avoid compilation error
- suppress compilation warnings (suggested by @Johnex)
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 53 |
1 files changed, 36 insertions, 17 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index c8fbb1f..fd2ef7b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -91,23 +91,42 @@ endif() | |||
91 | 91 | ||
92 | if(MSVC) | 92 | if(MSVC) |
93 | add_definitions(-Dinline=__inline) | 93 | add_definitions(-Dinline=__inline) |
94 | 94 | message(STATUS "Using [${CMAKE_C_COMPILER_ID}] compiler") | |
95 | set(MSVC_DISABLED_WARNINGS_LIST | 95 | if(CMAKE_C_COMPILER_ID MATCHES "MSVC") |
96 | "C4057" # C4057: 'initializing' : 'unsigned char *' differs in | 96 | set(MSVC_DISABLED_WARNINGS_LIST |
97 | # indirection to slightly different base types from 'char [2]' | 97 | "C4057" # C4057: 'initializing' : 'unsigned char *' differs in |
98 | "C4100" # 'exarg' : unreferenced formal parameter | 98 | # indirection to slightly different base types from 'char [2]' |
99 | "C4127" # conditional expression is constant | 99 | "C4100" # 'exarg' : unreferenced formal parameter |
100 | "C4242" # 'function' : conversion from 'int' to 'uint8_t', | 100 | "C4127" # conditional expression is constant |
101 | # possible loss of data | 101 | "C4242" # 'function' : conversion from 'int' to 'uint8_t', |
102 | "C4244" # 'function' : conversion from 'int' to 'uint8_t', | 102 | # possible loss of data |
103 | # possible loss of data | 103 | "C4244" # 'function' : conversion from 'int' to 'uint8_t', |
104 | "C4267" # conversion from 'size_t' to 'some type that is almost | 104 | # possible loss of data |
105 | # certainly safe to convert a size_t to'. | 105 | "C4267" # conversion from 'size_t' to 'some type that is almost |
106 | "C4706" # assignment within conditional expression | 106 | # certainly safe to convert a size_t to'. |
107 | "C4820" # 'bytes' bytes padding added after construct 'member_name' | 107 | "C4706" # assignment within conditional expression |
108 | "C4996" # 'read': The POSIX name for this item is deprecated. Instead, | 108 | "C4820" # 'bytes' bytes padding added after construct 'member_name' |
109 | # use the ISO C++ conformant name: _read. | 109 | "C4996" # 'read': The POSIX name for this item is deprecated. Instead, |
110 | ) | 110 | # use the ISO C++ conformant name: _read. |
111 | ) | ||
112 | elseif(CMAKE_C_COMPILER_ID MATCHES "Intel") | ||
113 | add_definitions(-D_CRT_SUPPRESS_RESTRICT) | ||
114 | set(MSVC_DISABLED_WARNINGS_LIST | ||
115 | "C111" # Unreachable statement | ||
116 | "C128" # Unreachable loop | ||
117 | "C167" # Unexplict casting unsigned to signed | ||
118 | "C186" # Pointless comparison of unsigned int with zero | ||
119 | "C188" # Enumerated type mixed with another type | ||
120 | "C344" # Redeclared type | ||
121 | "C556" # Unexplict casting signed to unsigned | ||
122 | "C869" # Unreferenced parameters | ||
123 | "C1786" # Deprecated functions | ||
124 | "C2545" # Empty else statement | ||
125 | "C2557" # Comparing signed to unsigned | ||
126 | "C2722" # List init syntax is c++11 feature | ||
127 | "C3280" # Declaration hides variable | ||
128 | ) | ||
129 | endif() | ||
111 | string(REPLACE "C" " -wd" MSVC_DISABLED_WARNINGS_STR | 130 | string(REPLACE "C" " -wd" MSVC_DISABLED_WARNINGS_STR |
112 | ${MSVC_DISABLED_WARNINGS_LIST}) | 131 | ${MSVC_DISABLED_WARNINGS_LIST}) |
113 | string(REGEX REPLACE "[/-]W[1234][ ]?" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS}) | 132 | string(REGEX REPLACE "[/-]W[1234][ ]?" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS}) |