[Cmake-commits] [cmake-commits] king committed CMakeDetermineCompilerABI.cmake 1.6 1.7 CMakeParseImplicitLinkInfo.cmake 1.4 1.5

cmake-commits at cmake.org cmake-commits at cmake.org
Tue Oct 6 15:16:14 EDT 2009


Update of /cvsroot/CMake/CMake/Modules
In directory public:/mounts/ram/cvs-serv12412/Modules

Modified Files:
	CMakeDetermineCompilerABI.cmake 
	CMakeParseImplicitLinkInfo.cmake 
Log Message:
Log implicit link information parsing actions

This commit teaches the CMAKE_PARSE_IMPLICIT_LINK_INFO function to log
its actions.  We store the log in CMakeFiles/CMakeOutput.log at the top
of the project build tree.  This will make diagnosis of implicit link
information parsing problems easier.


Index: CMakeParseImplicitLinkInfo.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CMakeParseImplicitLinkInfo.cmake,v
retrieving revision 1.4
retrieving revision 1.5
diff -C 2 -d -r1.4 -r1.5
*** CMakeParseImplicitLinkInfo.cmake	28 Sep 2009 15:46:50 -0000	1.4
--- CMakeParseImplicitLinkInfo.cmake	6 Oct 2009 19:16:12 -0000	1.5
***************
*** 17,23 ****
  # code.
  
! function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var)
    set(implicit_libs "")
    set(implicit_dirs_tmp)
  
    # Parse implicit linker arguments.
--- 17,24 ----
  # code.
  
! function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var log_var)
    set(implicit_libs "")
    set(implicit_dirs_tmp)
+   set(log "")
  
    # Parse implicit linker arguments.
***************
*** 39,42 ****
--- 40,44 ----
      endif()
      if("${cmd}" MATCHES "${linker_regex}")
+       set(log "${log}  link line: [${line}]\n")
        string(REGEX REPLACE ";-([LYz]);" ";-\\1" args "${args}")
        foreach(arg IN LISTS args)
***************
*** 45,55 ****
--- 47,60 ----
            string(REGEX REPLACE "^-L" "" dir "${arg}")
            list(APPEND implicit_dirs_tmp ${dir})
+           set(log "${log}    arg [${arg}] ==> dir [${dir}]\n")
          elseif("${arg}" MATCHES "^-l[^:]")
            # Unix library.
            string(REGEX REPLACE "^-l" "" lib "${arg}")
            list(APPEND implicit_libs ${lib})
+           set(log "${log}    arg [${arg}] ==> lib [${lib}]\n")
          elseif("${arg}" MATCHES "^(.:)?[/\\].*\\.a$")
            # Unix library full path.
            list(APPEND implicit_libs ${arg})
+           set(log "${log}    arg [${arg}] ==> lib [${arg}]\n")
          elseif("${arg}" MATCHES "^-Y(P,)?")
            # Sun search path.
***************
*** 57,74 ****
--- 62,88 ----
            string(REPLACE ":" ";" dirs "${dirs}")
            list(APPEND implicit_dirs_tmp ${dirs})
+           set(log "${log}    arg [${arg}] ==> dirs [${dirs}]\n")
          elseif("${arg}" MATCHES "^-l:")
            # HP named library.
            list(APPEND implicit_libs ${arg})
+           set(log "${log}    arg [${arg}] ==> lib [${arg}]\n")
          elseif("${arg}" MATCHES "^-z(all|default|weak)extract")
            # Link editor option.
            list(APPEND implicit_libs ${arg})
+           set(log "${log}    arg [${arg}] ==> opt [${arg}]\n")
+         else()
+           set(log "${log}    arg [${arg}] ==> ignore\n")
          endif()
        endforeach()
        break()
      elseif("${line}" MATCHES "LPATH(=| is:? )")
+       set(log "${log}  LPATH line: [${line}]\n")
        # HP search path.
        string(REGEX REPLACE ".*LPATH(=| is:? *)" "" paths "${line}")
        string(REPLACE ":" ";" paths "${paths}")
        list(APPEND implicit_dirs_tmp ${paths})
+       set(log "${log}    dirs [${paths}]\n")
+     else()
+       set(log "${log}  ignore line: [${line}]\n")
      endif()
    endforeach()
***************
*** 79,87 ****
--- 93,107 ----
      get_filename_component(dir "${d}" ABSOLUTE)
      list(APPEND implicit_dirs "${dir}")
+     set(log "${log}  collapse dir [${d}] ==> [${dir}]\n")
    endforeach()
    list(REMOVE_DUPLICATES implicit_dirs)
  
+   # Log results.
+   set(log "${log}  implicit libs: [${implicit_libs}]\n")
+   set(log "${log}  implicit dirs: [${implicit_dirs}]\n")
+ 
    # Return results.
    set(${lib_var} "${implicit_libs}" PARENT_SCOPE)
    set(${dir_var} "${implicit_dirs}" PARENT_SCOPE)
+   set(${log_var} "${log}" PARENT_SCOPE)
  endfunction()

Index: CMakeDetermineCompilerABI.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CMakeDetermineCompilerABI.cmake,v
retrieving revision 1.6
retrieving revision 1.7
diff -C 2 -d -r1.6 -r1.7
*** CMakeDetermineCompilerABI.cmake	28 Sep 2009 15:46:47 -0000	1.6
--- CMakeDetermineCompilerABI.cmake	6 Oct 2009 19:16:12 -0000	1.7
***************
*** 67,71 ****
            # Skip this with Xcode for now.
            AND NOT "${CMAKE_GENERATOR}" MATCHES Xcode)
!         CMAKE_PARSE_IMPLICIT_LINK_INFO("${OUTPUT}" implicit_libs implicit_dirs)
        ENDIF()
        SET(CMAKE_${lang}_IMPLICIT_LINK_LIBRARIES "${implicit_libs}" PARENT_SCOPE)
--- 67,73 ----
            # Skip this with Xcode for now.
            AND NOT "${CMAKE_GENERATOR}" MATCHES Xcode)
!         CMAKE_PARSE_IMPLICIT_LINK_INFO("${OUTPUT}" implicit_libs implicit_dirs log)
!         FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
!           "Parsed ${lang} implicit link information from above output:\n${log}\n\n")
        ENDIF()
        SET(CMAKE_${lang}_IMPLICIT_LINK_LIBRARIES "${implicit_libs}" PARENT_SCOPE)



More information about the Cmake-commits mailing list