AddCompilerFlag("-Wpointer-arith")
AddCompilerFlag("-Wcast-align")
AddCompilerFlag("-Wreturn-type")
- AddCompilerFlag("-Wno-unused-function")
AddCompilerFlag("-ansi")
AddCompilerFlag("-pedantic")
AddCompilerFlag("-Wno-long-long")
# GCC #
##################################################################################################
if(_add_warning_flags)
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -W -Wall -Wswitch -Wformat -Wchar-subscripts -Wparentheses -Wmultichar -Wtrigraphs -Wpointer-arith -Wcast-align -Wreturn-type -Wno-unused-function -pedantic -Wno-long-long -Wshadow")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W -Wall -Wswitch -Wformat -Wchar-subscripts -Wparentheses -Wmultichar -Wtrigraphs -Wpointer-arith -Wcast-align -Wreturn-type -Wno-unused-function -pedantic -Wno-long-long -Wshadow")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -W -Wall -Wswitch -Wformat -Wchar-subscripts -Wparentheses -Wmultichar -Wtrigraphs -Wpointer-arith -Wcast-align -Wreturn-type -pedantic -Wno-long-long -Wshadow")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W -Wall -Wswitch -Wformat -Wchar-subscripts -Wparentheses -Wmultichar -Wtrigraphs -Wpointer-arith -Wcast-align -Wreturn-type -pedantic -Wno-long-long -Wshadow")
if(NOT WIN32)
# the -ansi flag makes MinGW unusable, so maybe it's better to omit it
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ansi")
# GCC gives bogus "array subscript is above array bounds" warnings in math.cpp
AddCompilerFlag("-Wno-array-bounds")
endif()
- if(Vc_GCC_VERSION VERSION_GREATER "4.7.99")
- # GCC 4.8 warns about stuff we don't care about
- # Some older GCC versions have problems to note that they don't support the flag
- AddCompilerFlag("-Wno-unused-local-typedefs")
- endif()
endif()
vc_add_compiler_flag(Vc_DEFINITIONS "-Wabi")
vc_add_compiler_flag(Vc_DEFINITIONS "-fabi-version=0") # ABI version 4 is required to make __m128 and __m256 appear as different types. 0 should give us the latest version.
# for now I don't know of any arguments I want to pass. -march and stuff is tried by OptimizeForArchitecture...
if(Vc_CLANG_VERSION VERSION_EQUAL "3.0")
UserWarning("Clang 3.0 has serious issues to compile Vc code and will most likely crash when trying to do so.\nPlease update to a recent clang version.")
- elseif(Vc_CLANG_VERSION VERSION_LESS "3.3")
+ elseif(Vc_CLANG_VERSION VERSION_EQUAL "3.2" AND NOT APPLE)
# the LLVM assembler gets FMAs wrong (bug 15040)
vc_add_compiler_flag(Vc_DEFINITIONS "-no-integrated-as")
endif()
vc_add_compiler_flag(Vc_DEFINITIONS "-Wno-local-type-template-args")
vc_add_compiler_flag(Vc_DEFINITIONS "-Wno-unnamed-type-template-args")
- AddCompilerFlag(-stdlib=libc++)
+ if(NOT DEFINED Vc_INSIDE_ROOT) # ROOT has to set this up
+ AddCompilerFlag(-stdlib=libc++)
+ endif()
endif()
- if(NOT Vc_COMPILER_IS_MSVC)
- if(NOT Vc_COMPILER_IS_INTEL)
- vc_add_compiler_flag(Vc_DEFINITIONS "-ffp-contract=fast")
- endif()
+ if(NOT Vc_COMPILER_IS_MSVC AND NOT Vc_COMPILER_IS_INTEL)
+ vc_add_compiler_flag(Vc_DEFINITIONS "-ffp-contract=fast")
endif()
OptimizeForArchitecture()
_vc_compile_one_implementation(${_objs} AVX "-mavx" "-xAVX" "/arch:AVX")
if(NOT Vc_XOP_INTRINSICS_BROKEN)
if(NOT Vc_FMA4_INTRINSICS_BROKEN)
- if (NOT Vc_COMPILER_IS_INTEL)
- _vc_compile_one_implementation(${_objs} SSE+XOP+FMA4 "-mxop -mfma4" "" "")
- _vc_compile_one_implementation(${_objs} AVX+XOP+FMA4 "-mavx -mxop -mfma4" "" "")
- endif()
+ _vc_compile_one_implementation(${_objs} SSE+XOP+FMA4 "-mxop -mfma4" "" "")
+ _vc_compile_one_implementation(${_objs} AVX+XOP+FMA4 "-mavx -mxop -mfma4" "" "")
endif()
_vc_compile_one_implementation(${_objs} SSE+XOP+FMA "-mxop -mfma" "" "")
_vc_compile_one_implementation(${_objs} AVX+XOP+FMA "-mavx -mxop -mfma" "" "")