summaryrefslogtreecommitdiffstats
path: root/Tests/FortranC
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-12-15 19:03:03 (GMT)
committerBrad King <brad.king@kitware.com>2009-12-15 19:03:03 (GMT)
commit1ac1058272b03fee1e4f5ca1de0fd46453a8b125 (patch)
tree8009c494a3cbac165496ff1f4962bdbdd7bdb176 /Tests/FortranC
parent0306080e6e11620f3b36ee515078f389bc00e4f3 (diff)
downloadCMake-1ac1058272b03fee1e4f5ca1de0fd46453a8b125.zip
CMake-1ac1058272b03fee1e4f5ca1de0fd46453a8b125.tar.gz
CMake-1ac1058272b03fee1e4f5ca1de0fd46453a8b125.tar.bz2
Honor real language flags in FortranC.Flags test
The test overrides the CMAKE_C_FLAGS and CMAKE_Fortran_FLAGS to test passing a specific flag to the compiler wrapper scripts. We fix it to honor any outside flags needed for the real compiler.
Diffstat (limited to 'Tests/FortranC')
-rw-r--r--Tests/FortranC/CMakeLists.txt4
-rw-r--r--Tests/FortranC/Flags.cmake.in5
2 files changed, 4 insertions, 5 deletions
diff --git a/Tests/FortranC/CMakeLists.txt b/Tests/FortranC/CMakeLists.txt
index 12d4165..f335583 100644
--- a/Tests/FortranC/CMakeLists.txt
+++ b/Tests/FortranC/CMakeLists.txt
@@ -14,11 +14,11 @@ file(REMOVE_RECURSE ${CMAKE_BINARY_DIR}/CMakeFiles/FortranCInterface)
if(FortranC_TEST_FLAGS)
# Test whether FortranCInterface checks see C flags.
set(ENV{TEST_OPT_CC} "--test-opt-cc=1")
- set(CMAKE_C_FLAGS "$ENV{TEST_OPT_CC}")
+ set(CMAKE_C_FLAGS "$ENV{TEST_OPT_CC} ${CMAKE_C_FLAGS}")
# Test whether FortranCInterface checks see Fortran flags.
set(ENV{TEST_OPT_FC} "--test-opt-fc=1")
- set(CMAKE_Fortran_FLAGS "$ENV{TEST_OPT_FC}")
+ set(CMAKE_Fortran_FLAGS "$ENV{TEST_OPT_FC} ${CMAKE_Fortran_FLAGS}")
endif()
include(FortranCInterface)
diff --git a/Tests/FortranC/Flags.cmake.in b/Tests/FortranC/Flags.cmake.in
index 8bf0c5c..0b82f0e 100644
--- a/Tests/FortranC/Flags.cmake.in
+++ b/Tests/FortranC/Flags.cmake.in
@@ -12,15 +12,14 @@ configure_file("${src}/test_opt.sh.in" "${bld}/fc.sh" @ONLY)
set(ID)
set(COMMAND)
-set(ENV{CFLAGS})
-set(ENV{FFLAGS})
-
execute_process(
WORKING_DIRECTORY "${bld}"
COMMAND ${CMAKE_COMMAND} "${src}" -G "@CMAKE_TEST_GENERATOR@"
"-DFortranC_TEST_FLAGS=1"
"-DCMAKE_C_COMPILER=${bld}/cc.sh"
+ "-DCMAKE_C_FLAGS:STRING=@CMAKE_C_FLAGS@"
"-DCMAKE_Fortran_COMPILER=${bld}/fc.sh"
+ "-DCMAKE_Fortran_FLAGS:STRING=@CMAKE_Fortran_FLAGS@"
RESULT_VARIABLE result
)