Skip to content

Commit

Permalink
[cmake] Add test for boot feature
Browse files Browse the repository at this point in the history
  • Loading branch information
tobil4sk committed Jan 17, 2025
1 parent 00eed53 commit 9d40b3d
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,11 @@ if(BUILD_TESTING)
haxe
)

find_program(
HAXELIB
haxelib
)

#####################
# hello.hl

Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit 9d40b3d

Please sign in to comment.