[Cmake-commits] [cmake-commits] king committed GNU-C.cmake 1.1 1.2 GNU-CXX.cmake 1.1 1.2 GNU-Fortran.cmake 1.1 1.2 GNU.cmake NONE 1.1

cmake-commits at cmake.org cmake-commits at cmake.org
Wed Dec 2 09:51:39 EST 2009


Update of /cvsroot/CMake/CMake/Modules/Compiler
In directory public:/mounts/ram/cvs-serv21811/Modules/Compiler

Modified Files:
	GNU-C.cmake GNU-CXX.cmake GNU-Fortran.cmake 
Added Files:
	GNU.cmake 
Log Message:
Split GNU compiler information files

This moves GNU compiler flags into new-style modules

  Compiler/GNU-<lang>.cmake
  Platform/<os>-GNU-<lang>.cmake

We use language-independent helper modules

  Compiler/GNU.cmake
  Platform/<os>-GNU.cmake

to define macros consolidating the information.


Index: GNU-C.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/Compiler/GNU-C.cmake,v
retrieving revision 1.1
retrieving revision 1.2
diff -C 2 -d -r1.1 -r1.2
*** GNU-C.cmake	23 Jul 2009 14:07:18 -0000	1.1
--- GNU-C.cmake	2 Dec 2009 14:51:32 -0000	1.2
***************
*** 1 ****
! SET(CMAKE_C_VERBOSE_FLAG "-v")
--- 1,2 ----
! include(Compiler/GNU)
! __compiler_gnu(C)

Index: GNU-Fortran.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/Compiler/GNU-Fortran.cmake,v
retrieving revision 1.1
retrieving revision 1.2
diff -C 2 -d -r1.1 -r1.2
*** GNU-Fortran.cmake	23 Jul 2009 14:07:18 -0000	1.1
--- GNU-Fortran.cmake	2 Dec 2009 14:51:35 -0000	1.2
***************
*** 1 ****
! SET(CMAKE_Fortran_VERBOSE_FLAG "-v")
--- 1,14 ----
! include(Compiler/GNU)
! __compiler_gnu(Fortran)
! 
! # No -DNDEBUG for Fortran.
! SET(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "-Os")
! SET(CMAKE_Fortran_FLAGS_RELEASE_INIT "-O3")
! 
! # We require updates to CMake C++ code to support preprocessing rules
! # for Fortran.
! SET(CMAKE_Fortran_CREATE_PREPROCESSED_SOURCE)
! SET(CMAKE_Fortran_CREATE_ASSEMBLY_SOURCE)
! 
! # Fortran-specific feature flags.
! SET(CMAKE_Fortran_MODDIR_FLAG -J)

Index: GNU-CXX.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/Compiler/GNU-CXX.cmake,v
retrieving revision 1.1
retrieving revision 1.2
diff -C 2 -d -r1.1 -r1.2
*** GNU-CXX.cmake	23 Jul 2009 14:07:18 -0000	1.1
--- GNU-CXX.cmake	2 Dec 2009 14:51:34 -0000	1.2
***************
*** 1 ****
! SET(CMAKE_CXX_VERBOSE_FLAG "-v")
--- 1,2 ----
! include(Compiler/GNU)
! __compiler_gnu(CXX)

--- NEW FILE: GNU.cmake ---

#=============================================================================
# Copyright 2002-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distributed this file outside of CMake, substitute the full
#  License text for the above reference.)

# This module is shared by multiple languages; use include blocker.
if(__COMPILER_GNU)
  return()
endif()
set(__COMPILER_GNU 1)

macro(__compiler_gnu lang)
  # Feature flags.
  set(CMAKE_${lang}_VERBOSE_FLAG "-v")
  set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-fPIC")
  set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared")

  # Initial configuration flags.
  set(CMAKE_${lang}_FLAGS_INIT "")
  set(CMAKE_${lang}_FLAGS_DEBUG_INIT "-g")
  set(CMAKE_${lang}_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
  set(CMAKE_${lang}_FLAGS_RELEASE_INIT "-O3 -DNDEBUG")
  set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
  set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
  set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
  if(NOT APPLE)
    set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem ")
  endif(NOT APPLE)
endmacro()



More information about the Cmake-commits mailing list