1. qtd
  2. repo

Commits

Max Samukha  committed 4189f1d

support for new dmd naming

  • Participants
  • Parent commits 6fe37cb
  • Branches default

Comments (0)

Files changed (1)

File cmake/FindD.cmake

View file
  • Ignore whitespace
         get_filename_component(DC ${DC} NAME)
     endif("${dc_path}" STREQUAL ${CMAKE_BINARY_DIR})
     exec_program(${DC} ARGS "" OUTPUT_VARIABLE d_output)
-    string(REGEX MATCH "Digital Mars D Compiler v[0-9]\\.[0-9]+" dmd_version "${d_output}")
+    string(REGEX MATCH "(Digital Mars|DMD32) D Compiler v[0-9]\\.[0-9]+" dmd_version "${d_output}")
     if (dmd_version)
         set(D_IS_MARS true)
         set(D_IS_DMD true)
-        set(D_COMPILER_NAME "Digital Mars D Compiler")
-        string(REGEX REPLACE "Digital Mars D Compiler v([0-9])\\.[0-9]+" "\\1" D_VERSION "${dmd_version}")
-        string(REGEX REPLACE "Digital Mars D Compiler v[0-9]\\.([0-9]+)" "\\1" D_FRONTEND "${dmd_version}")
+        string(REGEX REPLACE "(.+) v([0-9])\\.([0-9])+" "\\1" D_COMPILER_NAME "${dmd_version}")
+        string(REGEX REPLACE "${D_COMPILER_NAME} v([0-9])\\.[0-9]+" "\\1" D_VERSION "${dmd_version}")
+        string(REGEX REPLACE "${D_COMPILER_NAME} v[0-9]\\.([0-9]+)" "\\1" D_FRONTEND "${dmd_version}")
     else (dmd_version)
 	string(REGEX MATCH "LLVM-based D Compiler" is_ldc "${d_output}")
 	if (is_ldc)
     else(update_deps_tmp)
 	file(STRINGS ${deps_file_tmp} ${out})
     endif(update_deps_tmp)
-endmacro(get_files_depends out)
+endmacro(get_files_depends out)