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
|
||||
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
|
||||
find_package(SDL2 REQUIRED)
|
||||
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.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any
|
||||
@@ -43,6 +43,10 @@
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
// Unused argc, argv
|
||||
(void) argc;
|
||||
(void) argv;
|
||||
|
||||
// Initialize SDL
|
||||
if(SDL_Init(SDL_INIT_VIDEO) < 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user