INCLUDE_DIRECTORIES(${MPI_CXX_INCLUDE_PATH})
ADD_FLAGS(CMAKE_CXX_FLAGS "${MPI_CXX_COMPILE_FLAGS}")
- ADD_FLAGS(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${MPI_CXX_LINK_FLAGS}")
+ ADD_FLAGS(CMAKE_SHARED_LINKER_FLAGS "${MPI_CXX_LINK_FLAGS}")
LIST(APPEND deal_ii_external_libraries ${MPI_CXX_LIBRARIES})
SET(DEAL_II_COMPILER_SUPPORTS_MPI TRUE)
# #
#################################
-#
-# General optimization flags:
-#
-ADD_FLAGS(CMAKE_CXX_FLAGS_RELEASE "-O2")
-
-ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS_RELEASE "-funroll-loops")
-ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS_RELEASE "-fstrict-aliasing")
-ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS_RELEASE "-felide-constructors")
+IF (CMAKE_BUILD_TYPE MATCHES "Release")
+ #
+ # General optimization flags:
+ #
+ ADD_FLAGS(CMAKE_CXX_FLAGS_RELEASE "-O2")
-ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS_RELEASE "-Wno-unused")
+ ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS_RELEASE "-funroll-loops")
+ ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS_RELEASE "-fstrict-aliasing")
+ ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS_RELEASE "-felide-constructors")
+ ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS_RELEASE "-Wno-unused")
+ENDIF()
###############################
IF (CMAKE_BUILD_TYPE MATCHES "Debug")
ADD_DEFINITIONS("-DDEBUG")
-ENDIF()
-ADD_FLAGS(CMAKE_CXX_FLAGS_DEBUG "-O0")
+ ADD_FLAGS(CMAKE_CXX_FLAGS_DEBUG "-O0")
-ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS_DEBUG "-ggdb")
-ENABLE_IF_SUPPORTED(CMAKE_SHARED_LINKER_FLAGS "-ggdb")
-#
-# If -ggdb is not available, fall back to -g:
-#
-IF(NOT DEAL_II_HAVE_FLAG_-ggdb)
- ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS_DEBUG "-g")
- ENABLE_IF_SUPPORTED(CMAKE_SHARED_LINKER_FLAGS "-g")
+ ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS_DEBUG "-ggdb")
+ ENABLE_IF_SUPPORTED(CMAKE_SHARED_LINKER_FLAGS "-ggdb")
+ #
+ # If -ggdb is not available, fall back to -g:
+ #
+ IF(NOT DEAL_II_HAVE_FLAG_-ggdb)
+ ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS_DEBUG "-g")
+ ENABLE_IF_SUPPORTED(CMAKE_SHARED_LINKER_FLAGS "-g")
+ ENDIF()
ENDIF()
-