Skip to content

Commit

Permalink
Various fixes to make lodviewer compile on non-Windows systems.
Browse files Browse the repository at this point in the history
 * Missing include for strstr()
 * With -Wall -Wextra -Werror, unreferenced function arguments are
   treated as errors as well, made them unnamed
 * Fix linking to non-bundled GLFW (the target to link to is glfw in
   both cases, so just use that)

This still fails to link on Linux/macOS due to the GL library not being
linked.
  • Loading branch information
mosra committed Apr 18, 2020
1 parent e1c3ec9 commit 7cc22a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,13 @@ if(MESHOPT_BUILD_TOOLS)
set(GLFW_INSTALL OFF CACHE BOOL "")
add_subdirectory(${MESHOPT_BUILD_TOOLS_GLFW_FOLDER_NAME})
set(glfw3_FOUND TRUE)
set(glfw3_LIBRARY glfw)
else()
find_package(glfw3 3.3 QUIET)
endif()

if (glfw3_FOUND)
add_executable(lodviewer tools/lodviewer.cpp tools/meshloader.cpp)
target_link_libraries(lodviewer ${glfw3_LIBRARY} meshoptimizer)
target_link_libraries(lodviewer glfw meshoptimizer)
endif()
endif()

Expand Down
5 changes: 3 additions & 2 deletions tools/lodviewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <vector>

Expand Down Expand Up @@ -564,7 +565,7 @@ std::vector<File> files;
Options options;
bool redraw;

void keyhandler(GLFWwindow* window, int key, int scancode, int action, int mods)
void keyhandler(GLFWwindow* window, int key, int, int action, int)
{
if (action == GLFW_PRESS)
{
Expand Down Expand Up @@ -627,7 +628,7 @@ void keyhandler(GLFWwindow* window, int key, int scancode, int action, int mods)
}
}

void sizehandler(GLFWwindow* window, int width, int height)
void sizehandler(GLFWwindow*, int, int)
{
redraw = true;
}
Expand Down

0 comments on commit 7cc22a9

Please sign in to comment.