summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-08-02 18:58:18 (GMT)
committerBrad King <brad.king@kitware.com>2024-08-02 18:59:21 (GMT)
commit56064c39777a326c49512ec9caeb194323ae9c1b (patch)
tree299eab1ce357a8c482d60d07af65fab28475254c
parent289c30ad3ab31dbdc5348bf5450344f6ec08ceca (diff)
downloadCMake-56064c39777a326c49512ec9caeb194323ae9c1b.zip
CMake-56064c39777a326c49512ec9caeb194323ae9c1b.tar.gz
CMake-56064c39777a326c49512ec9caeb194323ae9c1b.tar.bz2
FortranCInterface: Simplify module symbol mangling detection regex
Simplify the change from commit 0f5b6dd215 (FortranCInterface: Add support for LLVMFlang mangling, 2022-09-09, v3.24.2~2^2).
-rw-r--r--Modules/FortranCInterface/Detect.cmake6
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/FortranCInterface/Detect.cmake b/Modules/FortranCInterface/Detect.cmake
index c975a4b..00b8ad5 100644
--- a/Modules/FortranCInterface/Detect.cmake
+++ b/Modules/FortranCInterface/Detect.cmake
@@ -96,8 +96,8 @@ set(_case_MYSUB "UPPER")
set(_case_MY_SUB "UPPER")
set(_global_regex "^(_*)(mysub|MYSUB)([_$]*)$")
set(_global__regex "^(_*)(my_sub|MY_SUB)([_$]*)$")
-set(_module_regex "^(_*)([A-Za-z$]*)(mymodule|MYMODULE)([A-Za-z_$]*)(mysub|MYSUB)([_$]*)$")
-set(_module__regex "^(_*)([A-Za-z$]*)(my_module|MY_MODULE)([A-Za-z_$]*)(my_sub|MY_SUB)([_$]*)$")
+set(_module_regex "^([A-Za-z_$]*)(mymodule|MYMODULE)([A-Za-z_$]*)(mysub|MYSUB)([_$]*)$")
+set(_module__regex "^([A-Za-z_$]*)(my_module|MY_MODULE)([A-Za-z_$]*)(my_sub|MY_SUB)([_$]*)$")
# Parse the symbol names.
foreach(symbol ${FortranCInterface_SYMBOLS})
@@ -116,7 +116,7 @@ foreach(symbol ${FortranCInterface_SYMBOLS})
# Look for module symbols.
string(REGEX REPLACE "${_module_${form}regex}"
- "\\1\\2;\\3;\\4;\\5;\\6" pieces "${symbol}")
+ "\\1;\\2;\\3;\\4;\\5" pieces "${symbol}")
list(LENGTH pieces len)
if(len EQUAL 5)
set(FortranCInterface_MODULE_${form}SYMBOL "${symbol}")