-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* pcmockup: refactor main into module * pcmockup: fix incorrect name for debugWindowSet * cmake: enable many warnings as errors * cmake: extract dependency setup code * cmake: disable gtest update step * cmake: extract sub-projects setup code * pcmockup: remove relative paths to renderer * remove unnecessary submodules * CMake: fix semantic merge errors due to rebase * Renderer: inversion of control for debug rendering * pcmockup: fix clang warnings being ignored on gcc build
- Loading branch information
Showing
19 changed files
with
459 additions
and
290 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Configures googletest for use in PebbleOfDoom | ||
|
||
configure_file(external/GTest.CMakeLists.txt.in googletest-download/CMakeLists.txt) | ||
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . | ||
RESULT_VARIABLE result | ||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/googletest-download ) | ||
if(result) | ||
message(FATAL_ERROR "CMake step for googletest failed: ${result}") | ||
endif() | ||
execute_process(COMMAND ${CMAKE_COMMAND} --build . | ||
RESULT_VARIABLE result | ||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/googletest-download ) | ||
if(result) | ||
message(FATAL_ERROR "Build step for googletest failed: ${result}") | ||
endif() | ||
|
||
# Prevent overriding the parent project's compiler/linker | ||
# settings on Windows | ||
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) | ||
|
||
# Add googletest directly to our build. This defines | ||
# the gtest and gtest_main targets. | ||
add_subdirectory(${CMAKE_BINARY_DIR}/googletest-src | ||
${CMAKE_BINARY_DIR}/googletest-build | ||
EXCLUDE_FROM_ALL) | ||
|
||
# The gtest/gtest_main targets carry header search path | ||
# dependencies automatically when using CMake 2.8.11 or | ||
# later. Otherwise we have to add them here ourselves. | ||
if (CMAKE_VERSION VERSION_LESS 2.8.11) | ||
include_directories("${gtest_SOURCE_DIR}/include") | ||
endif() | ||
|
||
# To add googletests in the best way regarding cmake version | ||
function(add_googletest TARGET PREFIX) | ||
if (CMAKE_VERSION VERSION_LESS "3.10.0") | ||
gtest_add_tests(TARGET ${TARGET} TEST_PREFIX ${PREFIX}) | ||
else() | ||
gtest_discover_tests(${TARGET} TEST_PREFIX ${PREFIX}) | ||
endif() | ||
endfunction(add_googletest) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Configures stb for use in PebbleOfDoom | ||
|
||
set(STB_DIR "${CMAKE_SOURCE_DIR}/external/stb") | ||
if (NOT EXISTS "${STB_DIR}/stb_image.h") | ||
message(FATAL_ERROR "Could not find stb_image, did you clone the submodules?") | ||
endif() | ||
|
||
set(sources_stb | ||
pcmockup/stb_impl.c | ||
${STB_DIR}/stb_image.h | ||
${STB_DIR}/stb_image_write.h | ||
) | ||
assign_source_group(${sources_stb}) | ||
|
||
add_library(stb ${sources_stb}) | ||
target_include_directories(stb PUBLIC | ||
${STB_DIR} | ||
"pcmockup" | ||
) | ||
|
||
set(STB_LIBRARY "stb") | ||
set(STB_INCLUDE_DIR ${STB_DIR}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
################################################################### | ||
# PC Mockup | ||
################################################################### | ||
|
||
set(sources_pcmockup | ||
pebble.h | ||
sdl.include.h | ||
stb.include.h | ||
pcmockup.h | ||
pcmockup.c | ||
pebblewindow.c | ||
debugwindow.c | ||
debugwindowset.c | ||
windowgrid.c | ||
) | ||
assign_source_group(${sources_pcmockup}) | ||
|
||
add_executable(pcmockup ${sources_pcmockup}) | ||
target_link_libraries(pcmockup | ||
${SDL2_LIBRARY} | ||
${STB_LIBRARY} | ||
podrenderer | ||
) | ||
target_include_directories(pcmockup | ||
PRIVATE ${SDL2_INCLUDE_DIR} | ||
) | ||
enable_warnings(pcmockup) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.