Warning, /geant4/examples/advanced/CaTS/modules/CaTSCXXFlags.cmake is written in an unsupported language. File is not indexed.
0001
0002 # start from nothing, so repeated inclusion of this into CMake context doesnt repeat the flags
0003 set(CMAKE_CXX_FLAGS)
0004
0005 if(WIN32)
0006
0007 # need to detect compiler not os?
0008 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W4") # overall warning level 4
0009 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -wd4996") # disable C4996: 'strdup': The POSIX name for this item is deprecated.
0010 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNOMINMAX")
0011 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_SCL_SECURE_NO_WARNINGS")
0012 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_CRT_SECURE_NO_WARNINGS")
0013 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_USE_MATH_DEFINES")
0014 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_ITERATOR_DEBUG_LEVEL=0")
0015
0016
0017 else(WIN32)
0018
0019 ## c++11 forced by AsioZMQ : AsioZMQ not used here, but expect best to use same compiler options as far as possible
0020 #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") ## huh nvcc compilation fails with this ???
0021 if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
0022 # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11 -stdlib=libc++")
0023 set(CMAKE_CXX_STANDARD 14)
0024 set(CMAKE_CXX_STANDARD_REQUIRED on)
0025 else ()
0026 #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
0027 #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++0x")
0028 # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11") #needed for numpyserver- on Linux ?
0029 set(CMAKE_CXX_STANDARD 14)
0030 set(CMAKE_CXX_STANDARD_REQUIRED on)
0031
0032 endif ()
0033
0034 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
0035 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden") ## avoid boostrap visibility warning at link
0036 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-show-option")
0037 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
0038 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-function")
0039
0040 if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
0041 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-comment")
0042 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated")
0043 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-shadow")
0044 else()
0045 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-private-field")
0046 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-shadow")
0047 endif()
0048
0049 endif(WIN32)
0050
0051
0052 if(FLAGS_VERBOSE)
0053 # https://cmake.org/Wiki/CMake_Useful_Variables
0054 message(STATUS "OpticksCompilationFlags.cmake : CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}")
0055 message(STATUS "OpticksCompilationFlags.cmake : CMAKE_CXX_FLAGS = ${CMAKE_CXX_FLAGS}")
0056 message(STATUS "OpticksCompilationFlags.cmake : CMAKE_CXX_FLAGS_DEBUG = ${CMAKE_CXX_FLAGS_DEBUG}")
0057 message(STATUS "OpticksCompilationFlags.cmake : CMAKE_CXX_FLAGS_RELEASE = ${CMAKE_CXX_FLAGS_RELEASE}")
0058 message(STATUS "OpticksCompilationFlags.cmake : CMAKE_CXX_FLAGS_RELWITHDEBINFO= ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
0059 message(STATUS "OpticksCompilationFlags.cmake : CMAKE_CXX_STANDARD : ${CMAKE_CXX_STANDARD} " )
0060 message(STATUS "OpticksCompilationFlags.cmake : CMAKE_CXX_STANDARD_REQUIRED : ${CMAKE_CXX_STANDARD_REQUIRED} " )
0061 endif()
0062
0063
0064