29 lines
948 B
CMake
Executable File
29 lines
948 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)
|
|
|
|
# Specify the custom HTML shell
|
|
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --shell-file ${CMAKE_SOURCE_DIR}/shell.html")
|
|
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --shell-file ${CMAKE_SOURCE_DIR}/shell.html")
|
|
|
|
# target_compile_options(GraphWeb PRIVATE --shell-file ${CMAKE_SOURCE_DIR}/shell.html)
|
|
# target_link_options(GraphWeb PRIVATE )
|
|
set_target_properties(GraphWeb PROPERTIES LINK_FLAGS "--bind -sEXPORTED_FUNCTIONS='[\"_main\", \"_draw_graph\"]' -sEXPORTED_RUNTIME_METHODS='[\"cwrap\", \"ccall\"]' --shell-file ${CMAKE_SOURCE_DIR}/shell.html")
|
|
# target_link_options(GraphWeb PRIVATE -)
|
|
|
|
|
|
endif()
|
|
|
|
|
|
target_link_libraries(GraphWeb PRIVATE m)
|