diff --git a/cmake/backend/emscripten.cmake b/cmake/backend/emscripten.cmake index b4f6966..6f91554 100644 --- a/cmake/backend/emscripten.cmake +++ b/cmake/backend/emscripten.cmake @@ -110,10 +110,6 @@ function(nui_add_emscripten_target) ${NUI_ADD_EMSCRIPTEN_TARGET_ARGS_TARGET}-prejs ALL DEPENDS ${NUI_ADD_EMSCRIPTEN_TARGET_ARGS_PREJS} ) - add_custom_target( - ${NUI_ADD_EMSCRIPTEN_TARGET_ARGS_TARGET}-parcel-dep - DEPENDS "${CMAKE_BINARY_DIR}/module_${NUI_ADD_EMSCRIPTEN_TARGET_ARGS_TARGET}/bin/index.html" - ) add_dependencies( ${NUI_ADD_EMSCRIPTEN_TARGET_ARGS_TARGET}-emscripten ${NUI_ADD_EMSCRIPTEN_TARGET_ARGS_TARGET}-prejs @@ -121,9 +117,9 @@ function(nui_add_emscripten_target) ) add_dependencies( ${NUI_ADD_EMSCRIPTEN_TARGET_ARGS_TARGET} - ${NUI_ADD_EMSCRIPTEN_TARGET_ARGS_TARGET}-parcel-dep emscripten-setup ) + set_property(TARGET ${NUI_ADD_EMSCRIPTEN_TARGET_ARGS_TARGET} PROPERTY OBJECT_DEPENDS "${CMAKE_BINARY_DIR}/module_${NUI_ADD_EMSCRIPTEN_TARGET_ARGS_TARGET}/bin/index.html") if (${TARGET_TYPE} STREQUAL "INTERFACE_LIBRARY") target_include_directories(${NUI_ADD_EMSCRIPTEN_TARGET_ARGS_TARGET} INTERFACE ${CMAKE_BINARY_DIR}/include) diff --git a/cmake/dependencies/fmt.cmake b/cmake/dependencies/fmt.cmake index b19e237..3e29537 100644 --- a/cmake/dependencies/fmt.cmake +++ b/cmake/dependencies/fmt.cmake @@ -4,8 +4,7 @@ include(FetchContent) FetchContent_Declare( fmt GIT_REPOSITORY https://github.com/fmtlib/fmt.git - GIT_TAG 5f774c0aed4af6494b412cd3883e0f09295bd79d - FIND_PACKAGE_ARGS NAMES fmt + GIT_TAG 5f774c0aed4af6494b412cd3883e0f09295bd79d ) FetchContent_MakeAvailable(fmt) \ No newline at end of file diff --git a/cmake/dependencies/portable_file_dialog.cmake b/cmake/dependencies/portable_file_dialog.cmake index ad016a1..becf9a7 100644 --- a/cmake/dependencies/portable_file_dialog.cmake +++ b/cmake/dependencies/portable_file_dialog.cmake @@ -5,8 +5,7 @@ include(FetchContent) FetchContent_Declare( portable_file_dialogs GIT_REPOSITORY https://github.com/5cript/portable-file-dialogs.git - GIT_TAG 5652fbd0df05f001aa2e92d86c22f762a03c1fd9 - FIND_PACKAGE_ARGS + GIT_TAG 5652fbd0df05f001aa2e92d86c22f762a03c1fd9 ) FetchContent_MakeAvailable(portable_file_dialogs) \ No newline at end of file diff --git a/nui/include/nui/frontend/attributes/reference.hpp b/nui/include/nui/frontend/attributes/reference.hpp index 427cce9..e3be62a 100644 --- a/nui/include/nui/frontend/attributes/reference.hpp +++ b/nui/include/nui/frontend/attributes/reference.hpp @@ -15,6 +15,15 @@ namespace Nui::Attributes }}; } + template + requires std::invocable + Attribute onMaterialize(T&& func) const + { + return operator=([&func](std::weak_ptr&& element) { + func(element.lock()->val()); + }); + } + Attribute operator=(std::weak_ptr& ref) const { return operator=([&ref](std::weak_ptr&& element) {