1 cmake_minimum_required(VERSION 3.10)
5 set(SUNCC ${PROJECT_BINARY_DIR}/../compiler/suncc)
6 function(target_add_sun_sources TARGET)
8 cmake_path(GET SRC STEM SUN_BASENAME)
9 set(SUN_OUTPUT ${PROJECT_BINARY_DIR}/${SUN_BASENAME}.c)
14 COMMAND ${SUNCC} ${SUN_OUTPUT} ${SRC}
17 list(APPEND SUN_C_SOURCES ${SUN_OUTPUT})
20 target_sources(${TARGET} PRIVATE ${SUN_C_SOURCES})
24 ${CMAKE_CURRENT_SOURCE_DIR}/test_1.sun
27 add_executable(suntest main.c)
28 target_add_sun_sources(suntest ${SUN_TEST_SOURCES})
29 #target_include_directories(suncc PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
30 #target_link_libraries(suncc suncore)
31 #target_link_libraries(suncc ${FLEX_LIBRARIES})