From ef3263e3a4ecc80052ed17ab5d7fb0a2e77bee9c Mon Sep 17 00:00:00 2001 From: dmt Date: Sun, 19 Jan 2025 17:36:36 -0800 Subject: [PATCH] build cleanup --- README.md | 4 ++++ renderlib/CMakeLists.txt | 1 - renderlib/Logging.cpp | 11 +++++++++-- test/CMakeLists.txt | 2 +- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 324712e1..2a4c4f95 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,10 @@ mkdir build cd build # (vs 2022) cmake -DCMAKE_TOOLCHAIN_FILE=D:\vcpkg\scripts\buildsystems\vcpkg.cmake -G "Visual Studio 17 2022" -A x64 -DVCPKG_TARGET_TRIPLET=x64-windows .. + +# or, example: ninja in separate build dir! +cmake -DCMAKE_TOOLCHAIN_FILE=C:\Users\dmt\source\repos\vcpkg\scripts\buildsystems\vcpkg.cmake -G "Ninja" -DVCPKG_TARGET_TRIPLET=x64-windows C:\Users\dmt\source\repos\allen-cell-animated\agave + cmake --build . ``` diff --git a/renderlib/CMakeLists.txt b/renderlib/CMakeLists.txt index a6af2156..ccd3ac84 100644 --- a/renderlib/CMakeLists.txt +++ b/renderlib/CMakeLists.txt @@ -103,5 +103,4 @@ target_link_libraries(renderlib IF(WIN32) target_link_libraries(renderlib glm::glm) - target_link_libraries(renderlib comsuppw.lib optimized comsuppw.lib debug comsuppwd.lib) ENDIF(WIN32) diff --git a/renderlib/Logging.cpp b/renderlib/Logging.cpp index f4886eac..13bd6041 100644 --- a/renderlib/Logging.cpp +++ b/renderlib/Logging.cpp @@ -3,16 +3,17 @@ #include #include +#include #include #include #include +#include #include #if defined(__APPLE__) || defined(__linux__) #include #include #elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) // WIN32 #include -#include #endif // the logs are written to LOGFILE @@ -34,10 +35,16 @@ getLogPath() PWSTR path = nullptr; HRESULT hr = SHGetKnownFolderPath(FOLDERID_LocalAppData, 0, nullptr, &path); if (SUCCEEDED(hr)) { - char* rootdir = _com_util::ConvertBSTRToString(path); + // Create a wstring_convert object with the appropriate codecvt facet + std::wstring_convert> converter; + + // Convert the wide string to a string + std::string rootdir = converter.to_bytes(path); + CoTaskMemFree(path); return std::filesystem::path(rootdir) / "AllenInstitute" / "agave"; } else { + CoTaskMemFree(path); std::cout << "Failed to get local app data directory." << std::endl; std::cout << "Falling back to user home directory." << std::endl; // use user home directory instead diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 8f64123d..6a5ec9d8 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -29,7 +29,7 @@ target_sources(agave_test PRIVATE target_link_libraries(agave_test PRIVATE renderlib - Qt::Widgets Qt::Core Qt::Gui Qt::Network Qt::OpenGL Qt::OpenGLWidgets Qt::WebSockets Qt::Xml + Qt6::Core Qt6::Gui Catch2WithMain )