IF( (NOT CMAKE_SYSTEM_NAME MATCHES "CYGWIN") AND
(NOT CMAKE_SYSTEM_NAME MATCHES "Windows") )
ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_DEBUG "-Wa,--compress-debug-sections")
- ENABLE_IF_SUPPORTED(DEAL_II_C_FLAGS_DEBUG "-Wa,--compress-debug-sections")
ENDIF()
# #
###########################################################################
-CHECK_INCLUDE_FILE("sys/resource.h" HAVE_SYS_RESOURCE_H)
-CHECK_INCLUDE_FILE("sys/time.h" HAVE_SYS_TIME_H)
-CHECK_INCLUDE_FILE("sys/times.h" HAVE_SYS_TIMES_H)
-CHECK_INCLUDE_FILE("sys/types.h" HAVE_SYS_TYPES_H)
+CHECK_INCLUDE_FILE_CXX("sys/resource.h" HAVE_SYS_RESOURCE_H)
+CHECK_INCLUDE_FILE_CXX("sys/time.h" HAVE_SYS_TIME_H)
+CHECK_INCLUDE_FILE_CXX("sys/times.h" HAVE_SYS_TIMES_H)
+CHECK_INCLUDE_FILE_CXX("sys/types.h" HAVE_SYS_TYPES_H)
#
# Windows/MinGW unistd.h is available but not all posix functions. So test
# for each funtion as well.
#
-CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H)
+CHECK_INCLUDE_FILE_CXX("unistd.h" HAVE_UNISTD_H)
CHECK_FUNCTION_EXISTS(gethostname HAVE_GETHOSTNAME)
CHECK_FUNCTION_EXISTS(getpid HAVE_GETPID)
CHECK_FUNCTION_EXISTS(rand_r HAVE_RAND_R)
IF(DEAL_II_WRETURN_TYPE_CONST_QUALIFIER_BUG)
ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS -Wno-return-type)
- ENABLE_IF_SUPPORTED(CMAKE_C_FLAGS -Wno-return-type)
ENDIF()
IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND
CMAKE_CXX_COMPILER_VERSION MATCHES "4.4.")
STRIP_FLAG(CMAKE_CXX_FLAGS "-pedantic")
- STRIP_FLAG(CMAKE_C_FLAGS "-pedantic")
ENDIF()
IF(DEAL_II_ADVANCE_WARNING_BUG)
ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS "-Wno-unused-parameter")
- ENABLE_IF_SUPPORTED(CMAKE_C_FLAGS "-Wno-unused-parameter")
ENDIF()
ENDIF()
IF(DEAL_II_TYPE_QUALIFIER_BUG)
ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS -Wno-ignored-qualifiers)
- ENABLE_IF_SUPPORTED(CMAKE_C_FLAGS -Wno-ignored-qualifiers)
ENDIF()
IF(DEAL_II_MPICXX)
SET(CMAKE_CXX_COMPILER ${MPI_CXX_COMPILER})
- SET(CMAKE_C_COMPILER ${MPI_C_COMPILER})
ENDIF()
SET(DEAL_II_COMPILER_SUPPORTS_MPI TRUE)
+++ /dev/null
-#####
-##
-## Copyright (C) 2012 by the deal.II authors
-##
-## This file is part of the deal.II library.
-##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
-##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
-
-#
-# See macro_deal_ii_add_library.cmake for an explanation of this macro
-#
-
-MACRO(DEAL_II_ADD_C_LIBRARY _library)
-
- FOREACH(_build ${DEAL_II_BUILD_TYPES})
- STRING(TOLOWER ${_build} _build_lowercase)
-
- ADD_LIBRARY(${_library}.${_build_lowercase}
- ${ARGN}
- )
-
- SET_TARGET_PROPERTIES(${_library}.${_build_lowercase} PROPERTIES
- LINK_FLAGS "${DEAL_II_SHARED_LINKER_FLAGS_${_build}}"
- COMPILE_DEFINITIONS "${DEAL_II_DEFINITIONS};${DEAL_II_DEFINITIONS_${_build}}"
- COMPILE_FLAGS "${DEAL_II_C_FLAGS_${_build}}"
- )
-
- FILE(APPEND
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/deal_ii_objects_${_build_lowercase}
- "$<TARGET_OBJECTS:${_library}.${_build_lowercase}>\n"
- )
- ENDFOREACH()
-
-ENDMACRO()
# CMAKE_BUILD_TYPE
# BUILD_SHARED_LIBS
# CMAKE_INSTALL_RPATH_USE_LINK_PATH
-# CMAKE_C_FLAGS *)
# CMAKE_CXX_FLAGS *)
# CMAKE_SHARED_LINKER_FLAGS *)
-# DEAL_II_C_FLAGS_DEBUG
# DEAL_II_CXX_FLAGS_DEBUG
# DEAL_II_SHARED_LINKER_FLAGS_DEBUG
-# DEAL_II_C_FLAGS_RELEASE
# DEAL_II_CXX_FLAGS_RELEASE
# DEAL_II_SHARED_LINKER_FLAGS_RELEASE
#
# CMAKE_(C|CXX)_FLAGS_(DEBUG|RELEASE)
#
FOREACH(_flag
- C_FLAGS_RELEASE
CXX_FLAGS_RELEASE
- C_FLAGS_DEBUG
CXX_FLAGS_DEBUG
)
IF(NOT "${CMAKE_${_flag}}" STREQUAL "")
# Set cached compiler flags to an empty string:
#
SET(DEAL_II_USED_FLAGS
- CMAKE_C_FLAGS
CMAKE_CXX_FLAGS
- CMAKE_SHARED_LINKER_FLAGS
- DEAL_II_C_FLAGS_DEBUG
DEAL_II_CXX_FLAGS_DEBUG
- DEAL_II_SHARED_LINKER_FLAGS_DEBUG
- DEAL_II_C_FLAGS_RELEASE
DEAL_II_CXX_FLAGS_RELEASE
+ CMAKE_SHARED_LINKER_FLAGS
+ DEAL_II_SHARED_LINKER_FLAGS_DEBUG
DEAL_II_SHARED_LINKER_FLAGS_RELEASE
)
#
-# We need a C compiler only for the compilation of the bundled umfpack
-# library, so we don't make much fuss about configuration and setup of the
-# C compiler and assume that CC and CXX are the same compiler brand, hence
-# supporting almost the same compiler flags.
-# (See setup in setup_compiler_flags_*.cmake)
-#
-# So, give a prominent error message in case CC and CXX differ:
+# TODO: Is there a way to set CMAKE_C_COMPILER to the same brand as
+# CMAKE_CXX_COMPILER?
#
IF(NOT ( "${CMAKE_C_COMPILER_ID}" STREQUAL "${CMAKE_CXX_COMPILER_ID}" AND
"${CMAKE_C_COMPILER_VERSION}" STREQUAL "${CMAKE_CXX_COMPILER_VERSION}" ) )
ENDIF()
ENDIF()
-
-#########################
-# #
-# Set up C FLAGS: #
-# #
-#########################
-
-#
-# For the moment we assume that CC and CXX are the same compiler and that
-# we can set (almost) the same default flags for both:
-#
-SET(CMAKE_C_FLAGS ${CMAKE_CXX_FLAGS})
-SET(DEAL_II_C_FLAGS_RELEASE ${DEAL_II_CXX_FLAGS_RELEASE})
-SET(DEAL_II_C_FLAGS_DEBUG ${DEAL_II_CXX_FLAGS_DEBUG})
-
-#
-# OK, touché, touché. We have to strip flags not supported by a C target:
-#
-STRIP_FLAG(CMAKE_C_FLAGS "-Wsynth")
-STRIP_FLAG(DEAL_II_C_FLAGS_RELEASE "-felide-constructors")
-
-#
-# and disable some warnings:
-#
-STRIP_FLAG(CMAKE_C_FLAGS "-Wall") # There is no other way to disable -Wunknown-pragma atm...
-STRIP_FLAG(CMAKE_C_FLAGS "-Wsign-compare")
-STRIP_FLAG(CMAKE_C_FLAGS "-Wwrite-strings")
-
ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_DEBUG "-grecord-gcc-switches")
ENDIF()
-
-#########################
-# #
-# Set up C FLAGS: #
-# #
-#########################
-
-#
-# For the moment we assume that CC and CXX are the same compiler and that
-# we can set (almost) the same default flags for both:
-#
-SET(CMAKE_C_FLAGS ${CMAKE_CXX_FLAGS})
-SET(DEAL_II_C_FLAGS_RELEASE ${DEAL_II_CXX_FLAGS_RELEASE})
-SET(DEAL_II_C_FLAGS_DEBUG ${DEAL_II_CXX_FLAGS_DEBUG})
-
ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_DEBUG "/Zi")
ENDIF()
-
-#########################
-# #
-# Set up C FLAGS: #
-# #
-#########################
-
-#
-# For the moment we assume that CC and CXX are the same compiler and that
-# we can set (almost) the same default flags for both:
-#
-SET(CMAKE_C_FLAGS ${CMAKE_CXX_FLAGS})
-SET(DEAL_II_C_FLAGS_RELEASE ${DEAL_II_CXX_FLAGS_RELEASE})
-SET(DEAL_II_C_FLAGS_DEBUG ${DEAL_II_CXX_FLAGS_DEBUG})
-
INCLUDE(CheckCXXCompilerFlag)
INCLUDE(CheckCXXSourceCompiles)
INCLUDE(CheckCXXSourceRuns)
-INCLUDE(CheckFunctionExists)
-INCLUDE(CheckIncludeFile)
+INCLUDE(CheckCXXSymbolExists)
INCLUDE(CheckIncludeFileCXX)
+INCLUDE(CheckFunctionExists)
+
FILE(APPEND ${_log} "# DEAL_II_SHARED_LINKER_FLAGS_DEBUG: ${DEAL_II_SHARED_LINKER_FLAGS_DEBUG}\n")
ENDIF()
-IF(FEATURE_UMFPACK_BUNDLED_CONFIGURED)
- FILE(APPEND ${_log}
-"#
-# The bundled UMFPACK library will be compiled with the following C compiler:
-# CMAKE_C_COMPILER: ${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION}
-# ${CMAKE_C_COMPILER}
-# CMAKE_C_FLAGS: ${CMAKE_C_FLAGS}
-"
- )
- IF(CMAKE_BUILD_TYPE MATCHES "Release")
- FILE(APPEND ${_log} "# DEAL_II_C_FLAGS_RELEASE: ${DEAL_II_C_FLAGS_RELEASE}\n")
- ENDIF()
- IF(CMAKE_BUILD_TYPE MATCHES "Debug")
- FILE(APPEND ${_log} "# DEAL_II_C_FLAGS_DEBUG: ${DEAL_II_C_FLAGS_DEBUG}\n")
- ENDIF()
-ENDIF()
-
IF(NOT DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS)
FILE(APPEND ${_log} "#\n# WARNING: DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS is set to OFF\n")
ELSEIF(NOT DEAL_II_KNOWN_COMPILER)
For internal use, for setting necessary compiler flags, e.g.
<code>-std=c++11</code> (if available):
<ul>
- <li> <code>CMAKE_CXX_FLAGS</code> (and <code>CMAKE_C_FLAGS</code>)
- <li> <code>DEAL_II_CXX_FLAGS_DEBUG</code> (and
- <code>DEAL_II_C_FLAGS_DEBUG</code>)
- <li> <code>DEAL_II_CXX_FLAGS_RELEASE</code> (and
- <code>DEAL_II_C_FLAGS_RELEASE</code>)
+ <li> <code>CMAKE_CXX_FLAGS</code>
+ <li> <code>DEAL_II_CXX_FLAGS_DEBUG</code>
+ <li> <code>DEAL_II_CXX_FLAGS_RELEASE</code>
</ul>
<li>