From 1699836b0632b5a16ceac7cfdcc76e0d753e0880 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 19 Nov 2009 17:42:48 -0500 Subject: FortranCInterface: Honor language flags in checks We pass CMAKE_C_FLAGS, CMAKE_CXX_FLAGS, and CMAKE_Fortran_FLAGS through try_compile() for the FortranCInterface Detect and Verify projects. This honors user-specified compiler flags for each language, thus supporting flags that affect the Fortran mangling. --- Modules/FortranCInterface/Detect.cmake | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Modules/FortranCInterface') diff --git a/Modules/FortranCInterface/Detect.cmake b/Modules/FortranCInterface/Detect.cmake index 70dbe27359..0f964a9066 100644 --- a/Modules/FortranCInterface/Detect.cmake +++ b/Modules/FortranCInterface/Detect.cmake @@ -39,6 +39,9 @@ try_compile(FortranCInterface_COMPILED ${FortranCInterface_BINARY_DIR} ${FortranCInterface_SOURCE_DIR} FortranCInterface + CMAKE_FLAGS + "-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}" + "-DCMAKE_Fortran_FLAGS=${CMAKE_Fortran_FLAGS}" OUTPUT_VARIABLE FortranCInterface_OUTPUT) set(FortranCInterface_COMPILED ${FortranCInterface_COMPILED}) unset(FortranCInterface_COMPILED CACHE) -- cgit v1.2.1