Add compiler errors/warnings flags
This commit is contained in:
@@ -42,6 +42,11 @@ add_executable(${PROJECT_NAME} ${SOURCES})
|
|||||||
# Add all headers files under the include directory
|
# Add all headers files under the include directory
|
||||||
target_include_directories(${PROJECT_NAME} PRIVATE include)
|
target_include_directories(${PROJECT_NAME} PRIVATE include)
|
||||||
|
|
||||||
|
# Add compiler errors/warnings flags
|
||||||
|
target_compile_options(${PROJECT_NAME} PRIVATE $<$<C_COMPILER_ID:MSVC>:/W4 /WX>)
|
||||||
|
target_compile_options(${PROJECT_NAME} PRIVATE $<$<NOT:$<C_COMPILER_ID:MSVC>>:-Wall -Wextra -pedantic -Werror>)
|
||||||
|
|
||||||
|
|
||||||
# Add SDL2 library
|
# Add SDL2 library
|
||||||
find_package(SDL2 REQUIRED)
|
find_package(SDL2 REQUIRED)
|
||||||
target_link_libraries(${PROJECT_NAME} SDL2::Main)
|
target_link_libraries(${PROJECT_NAME} SDL2::Main)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2018 Amine Ben Hassouna <amine.benhassouna@gmail.com>
|
* Copyright (c) 2018, 2019 Amine Ben Hassouna <amine.benhassouna@gmail.com>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any
|
* Permission is hereby granted, free of charge, to any
|
||||||
@@ -43,6 +43,10 @@
|
|||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
|
// Unused argc, argv
|
||||||
|
(void) argc;
|
||||||
|
(void) argv;
|
||||||
|
|
||||||
// Initialize SDL
|
// Initialize SDL
|
||||||
if(SDL_Init(SDL_INIT_VIDEO) < 0)
|
if(SDL_Init(SDL_INIT_VIDEO) < 0)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user