Skip to content

Commit d0dc513

Browse files
committed
Enable -Wall -Werror
1 parent c2181b6 commit d0dc513

File tree

7 files changed

+10
-14
lines changed

7 files changed

+10
-14
lines changed

CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ add_definitions(
2121
-std=c++11
2222
-DGLFW_INCLUDE_GLCOREARB=1
2323
-DGLFW_INCLUDE_GLEXT=1
24+
-Werror
25+
-Wall
2426
)
2527

2628
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")

flogl/CMakeLists.txt

+3-7
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ set(ALL_LIBS
2323
${GLFW_LIBRARY}
2424
)
2525

26-
add_definitions(
27-
-std=c++11
28-
-D_CRT_SECURE_NO_WARNINGS
29-
)
3026

3127
add_executable(toblob util/toblob.cpp)
3228

@@ -37,7 +33,7 @@ set(FASTLED_SOURCES
3733
"${FastLED_SRC}/lib8tion.cpp"
3834
)
3935
set_source_files_properties(${FASTLED_SOURCES}
40-
PROPERTIES COMPILE_FLAGS "-include platform.h"
36+
PROPERTIES COMPILE_FLAGS "-include platform.h -Wno-mismatched-tags -Wno-unused-private-field"
4137
)
4238
source_group(FastLED FILES ${FASTLED_SOURCES})
4339

@@ -46,7 +42,7 @@ set(FLOGL_SOURCES
4642
shader.cpp
4743
texture.cpp
4844
Window.cpp
49-
"${CMAKE_CURRENT_BINARY_DIR}/LedTexture.cpp"
45+
"${CMAKE_CURRENT_BINARY_DIR}/LedTexture.hpp"
5046
)
5147

5248
# Disable annoying #pragma messages.
@@ -60,7 +56,7 @@ add_library(flogl
6056
)
6157

6258
add_custom_command(
63-
OUTPUT LedTexture.cpp
59+
OUTPUT LedTexture.hpp
6460
COMMAND toblob "${CMAKE_CURRENT_SOURCE_DIR}/LED.DDS" "${CMAKE_CURRENT_BINARY_DIR}" LedTexture
6561
DEPENDS toblob LED.DDS
6662
)

flogl/Window.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <glm/glm.hpp>
55
#include "Config.hpp"
66

7-
class GLFWwindow;
7+
struct GLFWwindow;
88

99
namespace flogl {
1010

flogl/cmake/Modules/FindFastLED.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ find_package_handle_standard_args(FastLED DEFAULT_MSG FastLED_BASE)
99
set(FastLED_SRC "${FASTLED_DIR}/src")
1010
set(FastLED_INCLUDE "${FASTLED_DIR}/src")
1111

12-
include_directories("${FastLED_INCLUDE}")
12+
include_directories(SYSTEM "${FastLED_INCLUDE}")

flogl/flogl.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const std::string FRAGMENT_SHADER =
4242
;
4343
}
4444

45-
#include "LedTexture.cpp"
45+
#include "LedTexture.hpp"
4646

4747
class Flogl::Impl
4848
{

flogl/texture.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,10 @@ GLuint loadDDS(const unsigned char* binary_image, unsigned size)
6060

6161
unsigned int height = hdr.dwHeight;
6262
unsigned int width = hdr.dwWidth;
63-
unsigned int linearSize = hdr.dwPitchOrLinearSize;
6463
unsigned int mipMapCount = hdr.dwMipMapCount;
6564
unsigned int fourCC = hdr.ddspf.dwFourCC;
6665

6766
const unsigned char *buffer = binary_image + HEADER_SIZE;
68-
unsigned int components = (fourCC == FOURCC_DXT1) ? 3 : 4;
6967
unsigned int format;
7068
switch(fourCC)
7169
{

flogl/util/toblob.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ int main(int argc, char* argv[])
1212
std::cerr << "usage: " << argv[0] << " <in_file> <out_dir> <blob_name>" << std::endl;
1313
std::cerr << std::endl;
1414
std::cerr << "convert <in_file> to source code representing a blob name blobs::<blob_name>" << std::endl;
15-
std::cerr << "and write the result to <out_dir>/<blob_name>.cpp" << std::endl;
15+
std::cerr << "and write the result to <out_dir>/<blob_name>.hpp" << std::endl;
1616
return 1;
1717
}
1818
const char* in_file_name = argv[1];
@@ -26,7 +26,7 @@ int main(int argc, char* argv[])
2626
return 1;
2727
}
2828

29-
std::string out_file_name = std::string(out_dir_name) + "/" + blob_name + ".cpp";
29+
std::string out_file_name = std::string(out_dir_name) + "/" + blob_name + ".hpp";
3030
std::ofstream out_file(out_file_name.c_str());
3131
if (not out_file.good())
3232
{

0 commit comments

Comments
 (0)