summaryrefslogtreecommitdiff
path: root/Modules/FortranCInterface
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2009-08-05 16:55:57 -0400
committerBill Hoffman <bill.hoffman@kitware.com>2009-08-05 16:55:57 -0400
commit71287734a9344e130721502e6342ef0afb0554a4 (patch)
treed78f15673b82675ca0add5f1ee49e68b8fd62c47 /Modules/FortranCInterface
parent6e54b18b5d46a43a19c5f4e479f7ff3dc49445ac (diff)
downloadcmake-71287734a9344e130721502e6342ef0afb0554a4.tar.gz
Teach FortranC interface for Intel, PGI, and gcc 4.2
Diffstat (limited to 'Modules/FortranCInterface')
-rw-r--r--Modules/FortranCInterface/CMakeLists.txt8
-rw-r--r--Modules/FortranCInterface/my_module_.c1
-rw-r--r--Modules/FortranCInterface/mymodule_.c1
3 files changed, 8 insertions, 2 deletions
diff --git a/Modules/FortranCInterface/CMakeLists.txt b/Modules/FortranCInterface/CMakeLists.txt
index 4bc7a109d9..778c4f445c 100644
--- a/Modules/FortranCInterface/CMakeLists.txt
+++ b/Modules/FortranCInterface/CMakeLists.txt
@@ -21,12 +21,16 @@ list(REMOVE_DUPLICATES global_symbols)
# List manglings of module symbol names to try.
set(module_symbols
- __my_module_MOD_my_sub # GNU
+ __my_module_MOD_my_sub # GNU 4.3
+ __my_module__my_sub # GNU 4.2
+ __mymodule__mysub # GNU 4.2
__my_module_NMOD_my_sub # VisualAge
__mymodule_MOD_mysub # GNU
__mymodule_NMOD_mysub # VisualAge
+ my_module_my_sub_ # PGI 8
my_module$my_sub # HP
my_module_mp_my_sub_ # Intel
+ mymodule_mysub_ # PGI 8
mymodule$mysub # HP
mymodule_mp_mysub_ # Intel
${FortranCInterface_MODULE_SYMBOLS}
@@ -66,7 +70,7 @@ endforeach()
add_library(myfort STATIC mysub.f my_sub.f ${myfort_modules})
# Provide symbols through C but fall back to Fortran.
-add_library(symbols STATIC ${symbol_sources})
+add_library(symbols STATIC ${symbol_sources} mymodule_.c my_module_.c)
target_link_libraries(symbols myfort)
# Require symbols through Fortran.
diff --git a/Modules/FortranCInterface/my_module_.c b/Modules/FortranCInterface/my_module_.c
new file mode 100644
index 0000000000..bba63cb34d
--- /dev/null
+++ b/Modules/FortranCInterface/my_module_.c
@@ -0,0 +1 @@
+void my_module_(void){}
diff --git a/Modules/FortranCInterface/mymodule_.c b/Modules/FortranCInterface/mymodule_.c
new file mode 100644
index 0000000000..68550b296d
--- /dev/null
+++ b/Modules/FortranCInterface/mymodule_.c
@@ -0,0 +1 @@
+void mymodule_(void){}