Ticket #32716: patch-upstream-clang-detection.diff

File patch-upstream-clang-detection.diff, 1011 bytes (added by mojca (Mojca Miklavec), 12 years ago)

Upstream patch to recognize clang compiler in Geant4 9.5

  • cmake/Modules/Geant4LibraryBuildOptions.cmake

    old new endif() 
    171171#
    172172if(CMAKE_COMPILER_IS_GNUCXX)
    173173    set(GEANT4_COMPILER "g++")
     174elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
     175    set(GEANT4_COMPILER "clang")
    174176elseif(MSVC)
    175177    set(GEANT4_COMPILER "VC")
    176178elseif(CMAKE_CXX_COMPILER MATCHES "icpc.*|icc.*")
  • cmake/Modules/Geant4MakeRules_cxx.cmake

    old new message(STATUS "setting default compiler flags for CXX") 
    99#------------------------------------------------------------------------------
    1010# GNU C++ Compiler on all(?) platforms
    1111#
    12 if(CMAKE_COMPILER_IS_GNUCXX)
     12if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
    1313  set(CMAKE_CXX_FLAGS_INIT "-W -Wall -ansi -pedantic -Wno-non-virtual-dtor -Wno-long-long -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -pipe")
    1414  set(CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
    1515  set(CMAKE_CXX_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")