icc.cmake 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. ## ======================================================================== ##
  2. ## Copyright 2009-2017 Intel Corporation ##
  3. ## ##
  4. ## Licensed under the Apache License, Version 2.0 (the "License"); ##
  5. ## you may not use this file except in compliance with the License. ##
  6. ## You may obtain a copy of the License at ##
  7. ## ##
  8. ## http://www.apache.org/licenses/LICENSE-2.0 ##
  9. ## ##
  10. ## Unless required by applicable law or agreed to in writing, software ##
  11. ## distributed under the License is distributed on an "AS IS" BASIS, ##
  12. ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ##
  13. ## See the License for the specific language governing permissions and ##
  14. ## limitations under the License. ##
  15. ## ======================================================================== ##
  16. SET(FLAGS_SSE2 "-xsse2")
  17. SET(FLAGS_SSE3 "-xsse3")
  18. SET(FLAGS_SSSE3 "-xssse3")
  19. SET(FLAGS_SSE41 "-xsse4.1")
  20. SET(FLAGS_SSE42 "-xsse4.2")
  21. SET(FLAGS_AVX "-xAVX")
  22. SET(FLAGS_AVX2 "-xCORE-AVX2")
  23. SET(FLAGS_AVX512KNL "-xMIC-AVX512")
  24. SET(FLAGS_AVX512SKX "-xCORE-AVX512")
  25. OPTION(EMBREE_IGNORE_CMAKE_CXX_FLAGS "When enabled Embree ignores default CMAKE_CXX_FLAGS." ON)
  26. IF (EMBREE_IGNORE_CMAKE_CXX_FLAGS)
  27. SET(CMAKE_CXX_FLAGS "")
  28. ENDIF()
  29. SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fPIC -std=c++11 -fvisibility-inlines-hidden -fvisibility=hidden -no-ansi-alias -fasm-blocks")
  30. SET(CMAKE_CXX_FLAGS_DEBUG "-DDEBUG -DTBB_USE_DEBUG -g -O0")
  31. SET(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -O3 -restrict -no-inline-max-total-size -inline-factor=200 -no-inline-max-per-compile")
  32. SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-DDEBUG -DTBB_USE_DEBUG -g -O3 -restrict -no-inline-max-total-size -inline-factor=200 -no-inline-max-per-compile")
  33. # enable -static-intel and avoid to export ICC specific symbols from Embree
  34. SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-intel -no-intel-extensions")
  35. #SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -g -debug inline-debug-info")
  36. #SET(CMAKE_EXE_LINKER_FLAGS "-g")
  37. IF (APPLE)
  38. SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.7 ") # we only use MacOSX 10.7 features
  39. SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++" ) # link against C++11 stdlib
  40. ELSE(APPLE)
  41. SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
  42. ENDIF(APPLE)