2021-07-31 22:02:48 +05:30
|
|
|
set(EXAMPLES_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
|
function(example name)
|
2021-12-23 14:17:33 +01:00
|
|
|
add_executable(ftxui_example_${name} ${name}.cpp)
|
|
|
|
|
target_link_libraries(ftxui_example_${name} PUBLIC ${DIRECTORY_LIB})
|
2021-07-31 22:02:48 +05:30
|
|
|
file(RELATIVE_PATH dir ${EXAMPLES_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
|
set_property(GLOBAL APPEND PROPERTY FTXUI::EXAMPLES ${dir}/${name})
|
2022-08-30 18:52:33 +02:00
|
|
|
set_target_properties(ftxui_example_${name} PROPERTIES
|
|
|
|
|
CXX_STANDARD 20
|
|
|
|
|
)
|
2021-07-31 22:02:48 +05:30
|
|
|
endfunction(example)
|
|
|
|
|
|
2019-01-02 22:33:59 +01:00
|
|
|
add_subdirectory(component)
|
|
|
|
|
add_subdirectory(dom)
|
2021-03-22 00:26:52 +01:00
|
|
|
|
|
|
|
|
if (EMSCRIPTEN)
|
2022-03-13 18:51:46 +01:00
|
|
|
# 32MB should be enough to run all the examples, in debug mode.
|
|
|
|
|
target_link_options(component PUBLIC "SHELL: -s TOTAL_MEMORY=33554432")
|
2022-03-31 02:17:43 +02:00
|
|
|
target_link_options(component PUBLIC "SHELL: -s ASSERTIONS=1")
|
|
|
|
|
#string(APPEND CMAKE_EXE_LINKER_FLAGS " -s ALLOW_MEMORY_GROWTH=1")
|
|
|
|
|
#target_link_options(component PUBLIC "SHELL: -s ALLOW_MEMORY_GROWTH=1")
|
2022-03-13 18:51:46 +01:00
|
|
|
|
2021-07-31 22:02:48 +05:30
|
|
|
get_property(EXAMPLES GLOBAL PROPERTY FTXUI::EXAMPLES)
|
2021-03-22 00:26:52 +01:00
|
|
|
foreach(file
|
|
|
|
|
"index.html"
|
2022-07-09 18:39:01 +02:00
|
|
|
"sw.js"
|
2021-07-31 22:02:48 +05:30
|
|
|
"run_webassembly.py")
|
|
|
|
|
configure_file(${file} ${file})
|
2021-03-22 00:26:52 +01:00
|
|
|
endforeach(file)
|
|
|
|
|
endif()
|