From 5acd47fb820bbb0d817ea89f627b3e6e0863f042 Mon Sep 17 00:00:00 2001 From: Tim Ebbeke Date: Sat, 22 Jul 2023 01:14:07 +0200 Subject: [PATCH 1/3] Another attempt on fixing the Ninja dependency problem. --- cmake/backend/emscripten.cmake | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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) From d469462cef5fcf0ac66716bc50237ed1bbfe1789 Mon Sep 17 00:00:00 2001 From: Tim Ebbeke Date: Sat, 22 Jul 2023 01:15:13 +0200 Subject: [PATCH 2/3] Added reference helper for Nui::val accepting functions. --- nui/include/nui/frontend/attributes/reference.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) 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) { From d4e9f26c9b4038d3b089caeb2f6f130978d026ed Mon Sep 17 00:00:00 2001 From: "Tim.Ebbeke" Date: Mon, 14 Aug 2023 16:34:34 +0200 Subject: [PATCH 3/3] Fixed dependency files. --- cmake/dependencies/fmt.cmake | 3 +-- cmake/dependencies/portable_file_dialog.cmake | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) 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