[CMake] fortran flags in a c++ linked executable

Denis Scherbakov denis_scherbakov at yahoo.com
Tue Mar 31 12:36:11 EDT 2009


If you want to pass something to g++ linker, you should do this with -Wl,--my-special-flag

Denis



> > Should not the flag be passed to the linker? So in
> this case the linker flags are read from the c++ compiler
> flags?
> > 
> 
> I tried adding
> 	add_definitions( ${CMAKE_Fortran_FLAGS} )
> But the g++ linker complained about an unrecognized option
> (the -fconvert=big-endian option).
> 
> When linking, I pull in the gfortran library,
> 	target_link_libraries( readx gfortran )
> 
> When creating the fortran object files the appropriate
> flags are passed, but the g++ compiler has no notion of
> endian-ness...
> 
> Any other ideas?



      


More information about the CMake mailing list