Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
lalitb authored Dec 12, 2024
2 parents 19fc7ca + 0a4edad commit ea61f8f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
7 changes: 6 additions & 1 deletion lib/utils/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,15 @@ namespace MAT_NS_BEGIN {
std::string GetTempDirectory()
{
#ifdef _WIN32
auto lpGetTempPathW = reinterpret_cast<decltype(&::GetTempPathW)>(GetProcAddress(GetModuleHandle(TEXT("kernel32")), "GetTempPath2W"));
if (lpGetTempPathW == NULL)
{
lpGetTempPathW = ::GetTempPathW;
}
/* UTF-8 temp directory for Win32 Desktop apps */
std::string path = "";
wchar_t lpTempPathBuffer[MAX_PATH + 1] = { 0 };
if (::GetTempPathW(MAX_PATH, lpTempPathBuffer))
if (lpGetTempPathW(MAX_PATH, lpTempPathBuffer))
{
path = to_utf8_string(lpTempPathBuffer);
}
Expand Down
9 changes: 8 additions & 1 deletion tests/functests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,14 @@ if (EXISTS ${CMAKE_SOURCE_DIR}/lib/modules/exp/tests)
${CMAKE_SOURCE_DIR}/lib/modules/exp/tests/functests/ECSConfigCacheFuncTests.cpp
)
if (EXISTS ${CMAKE_SOURCE_DIR}/lib/modules/exp/tests/functests/test.json)
file(COPY_FILE ${CMAKE_SOURCE_DIR}/lib/modules/exp/tests/functests/test.json ${CMAKE_BINARY_DIR}/test.json)
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.21")
# Use file(COPY_FILE ...) for CMake 3.21 and later
file(COPY_FILE ${CMAKE_SOURCE_DIR}/lib/modules/exp/tests/functests/test.json ${CMAKE_BINARY_DIR}/test.json)
else()
# Use file(COPY ...) as an alternative for older versions
file(COPY ${CMAKE_SOURCE_DIR}/lib/modules/exp/tests/functests/test.json
DESTINATION ${CMAKE_BINARY_DIR})
endif()
endif()
endif()

Expand Down

0 comments on commit ea61f8f

Please sign in to comment.