Skip to content

Commit

Permalink
Fixed windows compile errors
Browse files Browse the repository at this point in the history
  • Loading branch information
goossens committed Feb 14, 2025
1 parent 7d22881 commit 435ede4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions deps/lunasvg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ file(GLOB LUNASVG_SOURCES
${lunasvg_SOURCE_DIR}/source/*.cpp)

add_library(lunasvg STATIC ${LUNASVG_SOURCES})
target_compile_definitions(lunasvg PUBLIC LUNASVG_BUILD_STATIC)
target_include_directories(lunasvg PUBLIC ${lunasvg_SOURCE_DIR}/include)
target_link_libraries(lunasvg PUBLIC plutovg)

Expand Down
1 change: 1 addition & 0 deletions deps/plutovg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ file(GLOB PLUTOVG_SOURCES
${plutovg_SOURCE_DIR}/source/*.c)

add_library(plutovg STATIC ${PLUTOVG_SOURCES})
target_compile_definitions(plutovg PUBLIC "PLUTOVG_BUILD_STATIC")
target_include_directories(plutovg PUBLIC ${plutovg_SOURCE_DIR}/include)

set_target_properties(plutovg PROPERTIES FOLDER "deps")
10 changes: 7 additions & 3 deletions gfx/framework/OtFramework.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
#include <vector>

#if _WIN32
#define NOMINMAX
#define WIN32_LEAN_AND_MEAN
#undef APIENTRY
#include <windows.h>
#include <shellapi.h>

#else
#include <stdlib.h>
Expand Down Expand Up @@ -237,7 +241,6 @@ void OtFramework::setAntiAliasing(int aa) {
// MacOS version is in OtMacos.mm as it requires Objective-C

#else

void OtFramework::openURL(const std::string& url) {
#if _WIN32
WCHAR *temp = new WCHAR[url.size() + 1];
Expand All @@ -247,8 +250,9 @@ void OtFramework::openURL(const std::string& url) {

#else
#include <stdlib.h>
std::string op = std::string("xdg-open '").append(url).append("'");
return system(op.c_str()) == 0;

std::string command = std::string("xdg-open '").append(url).append("'");
system(command.c_str());
#endif
}

Expand Down

0 comments on commit 435ede4

Please sign in to comment.