Skip to content

Commit

Permalink
Quick fix
Browse files Browse the repository at this point in the history
FreeGLUT quick fix: See `https://github.com/dcnieho/FreeGLUT/pull/76`
Fixed CMake failure: See `https://github.com/google/liquidfun/issues/110`
Also `-Werror` is removed since I am not the one to maintain it
  • Loading branch information
yesh0 committed Apr 7, 2022
1 parent 7f20402 commit a7463b1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 28 deletions.
8 changes: 8 additions & 0 deletions freeglut/src/fg_gl2.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@
#include "fg_internal.h"
#include "fg_gl2.h"

FGH_PFNGLGENBUFFERSPROC fghGenBuffers;
FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers;
FGH_PFNGLBINDBUFFERPROC fghBindBuffer;
FGH_PFNGLBUFFERDATAPROC fghBufferData;
FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray;
FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray;
FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer;

void FGAPIENTRY glutSetVertexAttribCoord3(GLint attrib) {
if (fgStructure.CurrentWindow != NULL)
fgStructure.CurrentWindow->Window.attribute_v_coord = attrib;
Expand Down
14 changes: 7 additions & 7 deletions freeglut/src/fg_gl2.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ typedef void (APIENTRY *FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index);
typedef void (APIENTRY *FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint);
typedef void (APIENTRY *FGH_PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);

FGH_PFNGLGENBUFFERSPROC fghGenBuffers;
FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers;
FGH_PFNGLBINDBUFFERPROC fghBindBuffer;
FGH_PFNGLBUFFERDATAPROC fghBufferData;
FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray;
FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray;
FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer;
extern FGH_PFNGLGENBUFFERSPROC fghGenBuffers;
extern FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers;
extern FGH_PFNGLBINDBUFFERPROC fghBindBuffer;
extern FGH_PFNGLBUFFERDATAPROC fghBufferData;
extern FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray;
extern FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray;
extern FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer;

# endif

Expand Down
25 changes: 4 additions & 21 deletions liquidfun/Box2D/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.7)

project(Box2D)

Expand Down Expand Up @@ -75,7 +75,7 @@ if(MSVC)
elseif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR
CMAKE_COMPILER_IS_CLANGXX)
# Set the maximum warning level for gcc.
set(C_FLAGS_WARNINGS "-Wall -Werror -Wno-long-long -Wno-variadic-macros")
set(C_FLAGS_WARNINGS "-Wall -Wno-long-long -Wno-variadic-macros")
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${C_FLAGS_WARNINGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${C_FLAGS_WARNINGS}")
Expand All @@ -99,23 +99,6 @@ if (BOX2D_CODE_COVERAGE AND
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${GCOV_FLAGS}")
endif()

# The XCode generator ignores CMAKE_C_FLAGS AND CMAKE_CXX_FLAGS so flags
# need to be added with target properties.
# The following functions track the list of targets so that it's possible to
# add flags to all targets using target properties.
set(ALL_TARGETS "" CACHE INTERNAL "")
# Override add_library() and adding the target to the ALL_TARGETS variable.
function(add_library name)
_add_library(${name} ${ARGN})
set(ALL_TARGETS "${ALL_TARGETS}" "${name}" CACHE INTERNAL "")
endfunction(add_library)

# Override add_executable() and adding the target to the ALL_TARGETS variable.
function(add_executable name)
_add_executable(${name} ${ARGN})
set(ALL_TARGETS "${ALL_TARGETS}" "${name}" CACHE INTERNAL "")
endfunction(add_executable)

# The Box2D library.
add_subdirectory(Box2D)

Expand All @@ -141,7 +124,7 @@ endif(BOX2D_INSTALL_DOC)

# Set the warning flags for all targets when using the Xcode generator.
if(CMAKE_COMPILER_IS_CLANGXX)
foreach(target ${ALL_TARGETS})
foreach(target ${BUILDSYSTEM_TARGETS})
set_target_properties(${target} PROPERTIES XCODE_ATTRIBUTE_WARNING_CFLAGS
"${C_FLAGS_WARNINGS}")
endforeach(target)
Expand All @@ -161,7 +144,7 @@ endif()
# Override / reset the output directory for all targets.
set(LIB_OUTPUT_DIR "${OUTPUT_SUBDIR}")
set(EXE_OUTPUT_DIR "${OUTPUT_SUBDIR}")
foreach(target ${ALL_TARGETS})
foreach(target ${BUILDSYSTEM_TARGETS})
set_target_properties(
${target} PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${LIB_OUTPUT_DIR}"
Expand Down

1 comment on commit a7463b1

@UtsavBalar1231
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thankyou brother, appreciate your work in fixing this goddamn broken POS library. 👍🏾

Please sign in to comment.