nestedvm.cmake 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. set(platform_common_sources nestedvm.c printing.c)
  2. set(platform_libs -lm)
  3. file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/applet.manifest
  4. "Main-Class: PuzzleApplet\n")
  5. include(FindJava)
  6. add_custom_target(nvm-puzzle-applet
  7. BYPRODUCTS ${CMAKE_BINARY_DIR}/PuzzleApplet.class
  8. COMMAND ${Java_JAVAC_EXECUTABLE}
  9. -source 1.7 -target 1.7 -d . -cp ${NESTEDVM}/build
  10. ${CMAKE_SOURCE_DIR}/PuzzleApplet.java
  11. DEPENDS ${CMAKE_SOURCE_DIR}/PuzzleApplet.java)
  12. function(get_platform_puzzle_extra_source_files OUTVAR NAME)
  13. set(${OUTVAR} PARENT_SCOPE)
  14. endfunction()
  15. function(set_platform_gui_target_properties TARGET)
  16. set(build_subdir ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}-tmp)
  17. add_custom_target(${TARGET}-nvm-build-subdir
  18. BYPRODUCTS ${build_subdir}
  19. COMMAND ${CMAKE_COMMAND} -E make_directory ${build_subdir})
  20. add_custom_target(${TARGET}-nvm-symlinks
  21. BYPRODUCTS ${build_subdir}/PuzzleApplet.class
  22. COMMAND ${CMAKE_SOURCE_DIR}/cmake/glob-symlinks.py
  23. ${CMAKE_BINARY_DIR} applet.manifest
  24. ${CMAKE_BINARY_DIR} PuzzleApplet\\*.class
  25. ${NESTEDVM}/build org/ibex/nestedvm/Registers.class
  26. ${NESTEDVM}/build org/ibex/nestedvm/UsermodeConstants.class
  27. ${NESTEDVM}/build org/ibex/nestedvm/Runtime*.class
  28. ${NESTEDVM}/build org/ibex/nestedvm/util/Platform\\*.class
  29. ${NESTEDVM}/build org/ibex/nestedvm/util/Seekable\\*.class
  30. WORKING_DIRECTORY ${build_subdir}
  31. DEPENDS
  32. ${TARGET}-nvm-build-subdir
  33. nvm-puzzle-applet
  34. ${CMAKE_SOURCE_DIR}/cmake/glob-symlinks.py)
  35. add_custom_target(${TARGET}-nvm-engine
  36. BYPRODUCTS ${build_subdir}/PuzzleEngine.class
  37. COMMAND ${Java_JAVA_EXECUTABLE}
  38. -cp ${NESTEDVM}/build:${NESTEDVM}/upstream/build/classgen/build
  39. org.ibex.nestedvm.Compiler -outformat class -d .
  40. PuzzleEngine ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}
  41. DEPENDS
  42. ${TARGET}-nvm-build-subdir
  43. ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}
  44. WORKING_DIRECTORY ${build_subdir})
  45. add_custom_target(${TARGET}-jar ALL
  46. COMMAND ${Java_JAR_EXECUTABLE}
  47. cfm ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}.jar
  48. applet.manifest PuzzleEngine.class PuzzleApplet*.class org
  49. WORKING_DIRECTORY ${build_subdir}
  50. DEPENDS
  51. nvm-puzzle-applet
  52. ${TARGET}-nvm-build-subdir
  53. ${TARGET}-nvm-symlinks
  54. ${TARGET}-nvm-engine)
  55. endfunction()
  56. function(set_platform_puzzle_target_properties NAME TARGET)
  57. endfunction()
  58. function(build_platform_extras)
  59. endfunction()