mirror of
https://github.com/ysoftdevs/cpp-examples.git
synced 2026-02-25 20:05:12 +01:00
use gradle to build example
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
// sdl2-sample.cpp : SDL2 example - initialize and quit
|
||||
//
|
||||
|
||||
#include <tchar.h>
|
||||
#include "SDL.h"
|
||||
|
||||
int _tmain(int argc, _TCHAR* argv[])
|
||||
{
|
||||
SDL_Init(SDL_INIT_EVERYTHING);
|
||||
SDL_Quit();
|
||||
return 0;
|
||||
}
|
||||
|
||||
28
sdl/01-sdl2-init/build.gradle
Normal file
28
sdl/01-sdl2-init/build.gradle
Normal file
@@ -0,0 +1,28 @@
|
||||
apply plugin: 'c'
|
||||
apply plugin: 'visual-studio'
|
||||
|
||||
sources {
|
||||
main {
|
||||
c {
|
||||
source {
|
||||
// Include just source, avoid including *.swp and other helper files
|
||||
include "**/*.c"
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDir "../build/SDL2-2.0.3/include"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
executables {
|
||||
main {
|
||||
binaries.all {
|
||||
if (toolChain in VisualCpp) {
|
||||
linker.args "/machine:X86", "/SUBSYSTEM:WINDOWS", "../build/SDL2-2.0.3/lib/x86/SDL2.lib"
|
||||
//linker.args "/SUBSYSTEM:WINDOWS", "/LIBPATH:../build/SDL2-2.0.3/lib/x86/", "SDL2.lib"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
11
sdl/01-sdl2-init/src/main/c/sdl-init.c
Normal file
11
sdl/01-sdl2-init/src/main/c/sdl-init.c
Normal file
@@ -0,0 +1,11 @@
|
||||
// sdl2-sample.cpp : SDL2 example - initialize and quit
|
||||
//
|
||||
|
||||
#include "SDL.h"
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
SDL_Init(SDL_INIT_EVERYTHING);
|
||||
SDL_Quit();
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user