FortranCInterface: Compile separate Fortran lib in VerifyC[XX]

The Intel Fortran plugin for Visual Studio requires Fortran source files
to be compiled in a separate target from C and C++ code.  Compile the
VerifyFortran.f source file in a separate library and link the main
VerifyFortanC executable to it.
This commit is contained in:
Brad King 2011-09-08 14:56:48 -04:00
parent 38aab37962
commit 71402eb252
1 changed files with 3 additions and 1 deletions

View File

@ -24,7 +24,9 @@ include(FortranCInterface)
FortranCInterface_HEADER(VerifyFortran.h SYMBOLS VerifyFortran)
include_directories(${VerifyFortranC_BINARY_DIR})
add_executable(VerifyFortranC main.c VerifyC.c VerifyFortran.f ${VerifyCXX})
add_library(VerifyFortran STATIC VerifyFortran.f)
add_executable(VerifyFortranC main.c VerifyC.c ${VerifyCXX})
target_link_libraries(VerifyFortranC VerifyFortran)
if(NOT VERIFY_CXX)
# The entry point (main) is defined in C; link with the C compiler.