gcc.cmake 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 "-msse2")
  17. SET(FLAGS_SSE3 "-msse3")
  18. SET(FLAGS_SSSE3 "-mssse3")
  19. SET(FLAGS_SSE41 "-msse4.1")
  20. SET(FLAGS_SSE42 "-msse4.2")
  21. SET(FLAGS_AVX "-mavx")
  22. SET(FLAGS_AVX2 "-mf16c -mavx2 -mfma -mlzcnt -mbmi -mbmi2")
  23. SET(FLAGS_AVX512KNL "-mavx512f -mavx512pf -mavx512er -mavx512cd")
  24. SET(FLAGS_AVX512SKX "-mavx512f -mavx512dq -mavx512cd -mavx512bw -mavx512vl")
  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 -fno-strict-aliasing")
  30. SET(CMAKE_CXX_FLAGS_DEBUG "-DDEBUG -DTBB_USE_DEBUG -g -O0")
  31. SET(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -O3")
  32. SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-DDEBUG -DTBB_USE_DEBUG -g -O3")
  33. SET(CMAKE_EXE_LINKER_FLAGS "")
  34. IF (APPLE)
  35. SET (CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS_INIT} -dynamiclib)
  36. SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.7 -stdlib=libc++")
  37. ELSE(APPLE)
  38. SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
  39. ENDIF(APPLE)