File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -125,10 +125,15 @@ namespace MAT_NS_BEGIN {
125125 std::string GetTempDirectory ()
126126 {
127127#ifdef _WIN32
128+ auto lpGetTempPathW = reinterpret_cast <decltype (&::GetTempPathW)>(GetProcAddress (GetModuleHandle (TEXT (" kernel32" )), " GetTempPath2W" ));
129+ if (lpGetTempPathW == NULL )
130+ {
131+ lpGetTempPathW = ::GetTempPathW;
132+ }
128133 /* UTF-8 temp directory for Win32 Desktop apps */
129134 std::string path = " " ;
130135 wchar_t lpTempPathBuffer[MAX_PATH + 1 ] = { 0 };
131- if (:: GetTempPathW (MAX_PATH, lpTempPathBuffer))
136+ if (lpGetTempPathW (MAX_PATH, lpTempPathBuffer))
132137 {
133138 path = to_utf8_string (lpTempPathBuffer);
134139 }
Original file line number Diff line number Diff line change @@ -35,7 +35,14 @@ if (EXISTS ${CMAKE_SOURCE_DIR}/lib/modules/exp/tests)
3535 ${CMAKE_SOURCE_DIR} /lib/modules/exp/tests/functests/ECSConfigCacheFuncTests.cpp
3636 )
3737 if (EXISTS ${CMAKE_SOURCE_DIR} /lib/modules/exp/tests/functests/test .json)
38- file (COPY_FILE ${CMAKE_SOURCE_DIR} /lib/modules/exp/tests/functests/test .json ${CMAKE_BINARY_DIR} /test .json)
38+ if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.21" )
39+ # Use file(COPY_FILE ...) for CMake 3.21 and later
40+ file (COPY_FILE ${CMAKE_SOURCE_DIR} /lib/modules/exp/tests/functests/test .json ${CMAKE_BINARY_DIR} /test .json)
41+ else ()
42+ # Use file(COPY ...) as an alternative for older versions
43+ file (COPY ${CMAKE_SOURCE_DIR} /lib/modules/exp/tests/functests/test .json
44+ DESTINATION ${CMAKE_BINARY_DIR} )
45+ endif ()
3946 endif ()
4047endif ()
4148
You can’t perform that action at this time.
0 commit comments