Commit Graph

6 Commits

Author SHA1 Message Date
Brad King a66004bee0 Honor CMAKE_<LANG>_FLAGS[_<CONFIG>]_INIT set in toolchain files
Document these variables.

Change our convention for setting these variables from:

    set(CMAKE_C_FLAGS_INIT "...")

to

    string(APPEND CMAKE_C_FLAGS_INIT " ...")

so that any value previously set by a toolchain file will be used.

Automate the conversion with:

    sed -i 's/set *(\(CMAKE_\(C\|CXX\|Fortran\|RC\|ASM\|${[^}]\+}\)_FLAGS\(_[^_]\+\)\?_INIT \+"\)/string(APPEND \1 /' \
      Modules/Compiler/*.cmake Modules/Platform/*.cmake

and follow up with some manual fixes (e.g. to cases that already
meant to append).  Also revert the automated changes to contexts
that are not protected from running multiple times.
2016-07-06 10:13:31 -04:00
Brad King e888af9719 MSVC: Drop space in `/DNDEBUG` flag for consistency (#16052)
We define `NDEBUG` without a space after the `-D` option for most
compilers.  Remove the space for MSVC (and Intel Fortran) for
consistency.  The MS compiler technically does not document that
the `-D` argument may be separated from its value, though every
version to date supports it.
2016-04-07 10:54:43 -04:00
Brad King bd2ef44b55 Intel: Disable Fortran optimizations for Debug config on Windows (#15583)
The "/Od" flag is used for C and C++ languages in this configuration so
we should use it for Fortran too.

Suggested-by: Oleg V. Zhylin <ovz@yahoo.com>
2015-05-26 10:25:31 -04:00
Kitware Robot 77543bde41 Convert CMake-language commands to lower case
Ancient CMake versions required upper-case commands.  Later command
names became case-insensitive.  Now the preferred style is lower-case.

Run the following shell code:

cmake --help-command-list |
grep -v "cmake version" |
while read c; do
    echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g'
done >convert.sed &&
git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' |
egrep -z -v '^(Utilities/cm|Source/kwsys/)' |
xargs -0 sed -i -f convert.sed &&
rm convert.sed
2012-08-13 14:19:16 -04:00
Brad King 35a5838779 Intel: Fix Windows per-config Fortran flags (#12642)
Fix typo introduced in commit 66a08c10 (more uniform approach to enable
language, 2004-08-26).  The optimization option should be /O2 for
Release configurations and /O1 for MinSizeRel.

Suggested-by: He Yuqi <yuqi.he@gmail.com>
2012-01-02 13:56:33 -05:00
Brad King cd43636c95 Modernize Intel compiler info on Windows
This moves Intel compiler info on Windows into new-style modules

  Platform/Windows-Intel-<lang>.cmake

using language-independent helper module

  Platform/Windows-Intel.cmake

to define macros consolidating the information.
2010-12-16 09:50:05 -05:00