diff --git a/CMakeLists.txt b/CMakeLists.txt index 3688852f8..ca22de0b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -214,6 +214,11 @@ if(BUILD_TESTING) haxe ) + find_program( + HAXELIB + haxelib + ) + ##################### # hello.hl @@ -317,6 +322,25 @@ if(BUILD_TESTING) uv.hdll ) + ##################### + # hello.c (hashlink boot) + add_custom_command(OUTPUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test/hello_boot/hello.c + COMMAND ${HAXE_COMPILER} + -hl ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test/hello_boot/hello.hl + -cp ${CMAKE_SOURCE_DIR}/other/tests -main HelloWorld + COMMAND ${HAXELIB} run hashlink boot ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test/hello_boot/hello.hl + ) + add_executable(hello_boot + ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test/hello_boot/hello.c + ) + set_target_properties(hello_boot + PROPERTIES + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test/hello_boot + ) + target_link_libraries(hello_boot + libhl libhljit + ) + ##################### # Tests if (WITH_VM) @@ -337,6 +361,9 @@ if(BUILD_TESTING) add_test(NAME uvsample.hl COMMAND hl ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test/uvsample.hl 6001 ) + add_test(NAME hello_boot + COMMAND hello_boot + ) endif() add_test(NAME hello