Hopefully fixes the build issues

This commit is contained in:
Linus Probert 2018-05-18 23:11:09 +02:00
parent e222e51a0e
commit 60114ed159
4 changed files with 10 additions and 4 deletions

View File

@ -31,6 +31,10 @@ elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
set(GCC 1)
endif()
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
set(OSX 1)
endif()
set (default_build_type "Release")
if (NOT CMAKE_BUILD_TYPE AND default_build_type)
message( STATUS "Setting default buildtype to '${default_build_type}' as none was specified")
@ -202,7 +206,7 @@ if (MSVC)
endif (MSVC)
# TESTS:
IF (CMOCKA_FOUND AND NOT CLANG)
IF (CMOCKA_FOUND AND NOT OSX AND NOT CLANG)
find_package(Threads REQUIRED)
enable_testing()
add_executable(test_util test/test_util src/util)

View File

@ -19,7 +19,7 @@
#ifndef KEYBOARD_H_
#define KEYBOARD_H_
#include <SDL_events.h>
#include <SDL.h>
#include <stdbool.h>
#include "defines.h"

View File

@ -19,7 +19,7 @@
#ifndef KEYBOARDINPUT_H_
#define KEYBOARDINPUT_H_
#include <SDL_events.h>
#include <SDL.h>
#include <stdbool.h>
#define KEY_LEFT 1

View File

@ -98,8 +98,10 @@ test_keydown(void **state)
assert_true(key_is_down(&input, KEY_UP));
}
int main(void)
int main(int argc, char *argv[])
{
(void) argc;
(void) argv;
const struct CMUnitTest tests[] = {
cmocka_unit_test(test_keypress),