|
|
@ -11,6 +11,7 @@ endif() |
|
|
|
# Options |
|
|
|
# Options |
|
|
|
option(BUILD_SHARED_LIBS "Build shared libraries" OFF) |
|
|
|
option(BUILD_SHARED_LIBS "Build shared libraries" OFF) |
|
|
|
option(BLAZE_BUILD_EXAMPLES "Build the Blaze example programs" ${BLAZE_STANDALONE}) |
|
|
|
option(BLAZE_BUILD_EXAMPLES "Build the Blaze example programs" ${BLAZE_STANDALONE}) |
|
|
|
|
|
|
|
option(BLAZE_BUILD_TESTS "Build the Blaze test programs" ${BLAZE_STANDALONE}) |
|
|
|
|
|
|
|
|
|
|
|
# ------------------------------------------ |
|
|
|
# ------------------------------------------ |
|
|
|
|
|
|
|
|
|
|
@ -55,18 +56,19 @@ endif() |
|
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) |
|
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) |
|
|
|
|
|
|
|
|
|
|
|
# ------------------------------------------ |
|
|
|
# ------------------------------------------ |
|
|
|
# Library |
|
|
|
# Dependencies |
|
|
|
|
|
|
|
|
|
|
|
add_subdirectory("vendor/ruc") |
|
|
|
add_subdirectory("vendor/ruc") |
|
|
|
|
|
|
|
|
|
|
|
# ------------------------------------------ |
|
|
|
# ------------------------------------------ |
|
|
|
# Application target |
|
|
|
# Library target |
|
|
|
|
|
|
|
|
|
|
|
# Define source files |
|
|
|
# Define source files |
|
|
|
file(GLOB_RECURSE PROJECT_SOURCES "src/*.cpp") |
|
|
|
file(GLOB_RECURSE LIBRARY_SOURCES "src/*.cpp") |
|
|
|
|
|
|
|
|
|
|
|
add_executable(${PROJECT} ${PROJECT_SOURCES}) |
|
|
|
add_library(${PROJECT} ${LIBRARY_SOURCES}) |
|
|
|
target_include_directories(${PROJECT} PRIVATE "src") |
|
|
|
target_include_directories(${PROJECT} PUBLIC |
|
|
|
|
|
|
|
"src") |
|
|
|
target_link_libraries(${PROJECT} readline ruc) |
|
|
|
target_link_libraries(${PROJECT} readline ruc) |
|
|
|
|
|
|
|
|
|
|
|
# ------------------------------------------ |
|
|
|
# ------------------------------------------ |
|
|
@ -78,15 +80,16 @@ add_custom_target(${PROJECT}-lisp |
|
|
|
add_dependencies(${PROJECT} ${PROJECT}-lisp) |
|
|
|
add_dependencies(${PROJECT} ${PROJECT}-lisp) |
|
|
|
|
|
|
|
|
|
|
|
# ------------------------------------------ |
|
|
|
# ------------------------------------------ |
|
|
|
# Execute target |
|
|
|
# Example target |
|
|
|
|
|
|
|
|
|
|
|
add_custom_target(run |
|
|
|
if (BLAZE_BUILD_EXAMPLES) |
|
|
|
COMMAND ${PROJECT} -c |
|
|
|
add_subdirectory("example") |
|
|
|
DEPENDS ${PROJECT}) |
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
|
|
# ------------------------------------------ |
|
|
|
# ------------------------------------------ |
|
|
|
# Test targets |
|
|
|
# Test targets |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (BLAZE_BUILD_TESTS) |
|
|
|
function(make_test_target target_name step_name) |
|
|
|
function(make_test_target target_name step_name) |
|
|
|
add_custom_target(${target_name} |
|
|
|
add_custom_target(${target_name} |
|
|
|
COMMAND ../vendor/mal/runtest.py --deferrable --optional ../tests/${step_name}.mal -- ./${PROJECT}) |
|
|
|
COMMAND ../vendor/mal/runtest.py --deferrable --optional ../tests/${step_name}.mal -- ./${PROJECT}) |
|
|
@ -128,3 +131,4 @@ add_custom_target(perf |
|
|
|
COMMAND ./${PROJECT} ../tests/perf2.mal |
|
|
|
COMMAND ./${PROJECT} ../tests/perf2.mal |
|
|
|
COMMAND ./${PROJECT} ../tests/perf3.mal) |
|
|
|
COMMAND ./${PROJECT} ../tests/perf3.mal) |
|
|
|
add_dependencies(perf ${PROJECT}) |
|
|
|
add_dependencies(perf ${PROJECT}) |
|
|
|
|
|
|
|
endif() |
|
|
|