19 lines
600 B
CMake
Executable File
19 lines
600 B
CMake
Executable File
cmake_minimum_required(VERSION 3.21)
|
|
project(GraphWeb)
|
|
add_executable(GraphWeb
|
|
"main.cpp"
|
|
"lex.c"
|
|
"parser.c"
|
|
"tree.c"
|
|
"canvas_graph.cpp"
|
|
"errors.c"
|
|
"math_functions.c"
|
|
)
|
|
if (CMAKE_SYSTEM_NAME STREQUAL Emscripten)
|
|
set(CMAKE_EXECUTABLE_SUFFIX .html)
|
|
set_target_properties(GraphWeb PROPERTIES LINK_FLAGS "--bind -sEXPORTED_FUNCTIONS='[\"_main\", \"_draw_graph\", \"_set_expr\", \"_set_num_exprs\", \"_print_errors\"]' -sEXPORTED_RUNTIME_METHODS='[\"cwrap\", \"ccall\"]' --shell-file ${CMAKE_SOURCE_DIR}/shell.html")
|
|
endif()
|
|
|
|
|
|
target_link_libraries(GraphWeb PRIVATE m)
|