Commit d5267527 authored by Robert Kimball's avatar Robert Kimball

tweak cmake settings to work better on mac

parent 8d57ce68
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at # You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0 # http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, # distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
...@@ -62,7 +62,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") ...@@ -62,7 +62,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
set(NGRAPH_CXX_WARNING_FLAGS "") set(NGRAPH_CXX_WARNING_FLAGS "")
# Compiler-specific logic... # Compiler-specific logic...
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "^(Apple)?Clang$")
include( cmake/clang_4_0_flags.cmake ) include( cmake/clang_4_0_flags.cmake )
else() else()
message(WARNING "CMAKE_CXX_COMPILER_ID='${CMAKE_CXX_COMPILER_ID}'. CMAKE_CXX_COMPILER='${CMAKE_CXX_COMPILER}'. The only supported compiler is 'clang', but the selected compiler is '${CMAKE_CXX_COMPILER}'.") message(WARNING "CMAKE_CXX_COMPILER_ID='${CMAKE_CXX_COMPILER_ID}'. CMAKE_CXX_COMPILER='${CMAKE_CXX_COMPILER}'. The only supported compiler is 'clang', but the selected compiler is '${CMAKE_CXX_COMPILER}'.")
...@@ -71,10 +71,6 @@ endif() ...@@ -71,10 +71,6 @@ endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
FOREACH(F IN LISTS NGRAPH_CXX_WARNING_FLAGS)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${F}")
ENDFOREACH()
#----------------------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------------------
# The following 'add_subdirectory' call: # The following 'add_subdirectory' call:
......
...@@ -2,44 +2,45 @@ ...@@ -2,44 +2,45 @@
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at # You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0 # http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, # distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
SET(NGRAPH_CXX_WARNING_FLAGS set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=return-type")
"-Werror=return-type" set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=inconsistent-missing-override")
"-Werror=inconsistent-missing-override"
"-Weverything" # whitelist errors here
"-Wno-c++98-compat" set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Weverything")
"-Wno-c++98-compat-pedantic" set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c++98-compat")
"-Wno-padded" set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c++98-compat-pedantic")
"-Wno-weak-vtables" set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-padded")
"-Wno-global-constructors" set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-weak-vtables")
"-Wno-switch-enum" set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-global-constructors")
"-Wno-gnu-zero-variadic-macro-arguments" set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-switch-enum")
"-Wno-undef" set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-gnu-zero-variadic-macro-arguments")
"-Wno-exit-time-destructors" set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-undef")
"-Wno-missing-prototypes" set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-exit-time-destructors")
"-Wno-disabled-macro-expansion" set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-missing-prototypes")
"-Wno-pedantic" set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-disabled-macro-expansion")
"-Wno-documentation" set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-pedantic")
"-Wno-covered-switch-default" set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-documentation")
"-Wno-old-style-cast" set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-covered-switch-default")
"-Wno-unknown-warning-option" set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-old-style-cast")
"-Wno-sign-conversion" set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-warning-option")
"-Wno-sign-compare"
"-Wno-unused-parameter"
"-Wno-conversion"
"-Wno-float-equal"
"-Wno-duplicate-enum"
"-Wno-used-but-marked-unused"
"-Wno-c++11-compat-deprecated-writable-strings"
"-Wno-deprecated"
"-Wno-double-promotion"
)
# should remove these
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-sign-conversion")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-sign-compare")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-parameter")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-conversion")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-float-equal")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-duplicate-enum") # from numpy
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-used-but-marked-unused") # from sox
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c++11-compat-deprecated-writable-strings")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-double-promotion")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment