You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.3 KiB

  1. # Copyright (C) 2009 Sun Microsystems, Inc
  2. #
  3. # This program is free software; you can redistribute it and/or modify
  4. # it under the terms of the GNU General Public License as published by
  5. # the Free Software Foundation; version 2 of the License.
  6. #
  7. # This program is distributed in the hope that it will be useful,
  8. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. # GNU General Public License for more details.
  11. #
  12. # You should have received a copy of the GNU General Public License
  13. # along with this program; if not, write to the Free Software
  14. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  15. # Generates an ELF object file with dtrace entry points.
  16. # This object that must to be linked with together with
  17. # the target. This script needs to run on Solaris only
  18. # Do not follow symlinks in GLOB_RECURSE
  19. CMAKE_POLICY(SET CMP0009 NEW)
  20. FILE(GLOB_RECURSE OBJECTS *.o)
  21. # Use relative paths to generate shorter command line
  22. GET_FILENAME_COMPONENT(CURRENT_ABS_DIR . ABSOLUTE)
  23. FOREACH(OBJ ${OBJECTS})
  24. FILE(RELATIVE_PATH REL ${CURRENT_ABS_DIR} ${OBJ})
  25. LIST(APPEND REL_OBJECTS ${REL})
  26. ENDFOREACH()
  27. EXECUTE_PROCESS(
  28. COMMAND ${DTRACE} ${DTRACE_FLAGS} -o ${OUTFILE} -G -s ${DFILE} ${REL_OBJECTS}
  29. )