Update SDL build to Gradle 2.13

This commit is contained in:
Juraj Michalek
2016-05-16 09:13:09 +02:00
parent d9385f8503
commit 5fac352622
4 changed files with 11 additions and 69 deletions

View File

@@ -1,23 +1,12 @@
apply plugin: 'c'
apply plugin: 'visual-studio'
sources {
main {
c {
source {
// Include just source, avoid including *.swp and other helper files
include "**/*.c"
model {
components {
main(NativeExecutableSpec) {}
}
exportedHeaders {
srcDir "../build/include"
}
}
}
}
executables {
main {
binaries.all {
binaries {
all {
if (toolChain in VisualCpp) {
cCompiler.args "/MD"
linker.args "/SUBSYSTEM:CONSOLE", "/LIBPATH:../build/lib/",

View File

@@ -1,22 +1,12 @@
apply plugin: 'c'
apply plugin: 'visual-studio'
sources {
main {
c {
source {
include "**/*.c"
model {
components {
main(NativeExecutableSpec) {}
}
exportedHeaders {
srcDir "../build/include/SDL2"
}
}
}
}
executables {
main {
binaries.all {
binaries {
all {
if (toolChain in VisualCpp) {
cCompiler.args "/MD"
linker.args "/SUBSYSTEM:CONSOLE", "/LIBPATH:../build/lib/", "SDL2main.lib", "SDL2.lib"

View File

@@ -2,9 +2,7 @@
//
#include <stdio.h>
#include "SDL.h"
// Linux build will probably need little bit different include
//#include "SDL2/SDL.h"
#include "SDL2/SDL.h"
int main(int argc, char* argv[]) {
SDL_Window *win = NULL;

View File

@@ -1,35 +0,0 @@
apply plugin: 'c'
apply plugin: 'visual-studio'
sources {
main {
c {
source {
include "**/*.c"
}
exportedHeaders {
srcDir "../build/include"
}
}
}
}
executables {
main {
binaries.all {
if (toolChain in VisualCpp) {
cCompiler.args "/MD"
linker.args "/SUBSYSTEM:CONSOLE", "/LIBPATH:../build/lib/", "SDL2main.lib", "SDL2.lib"
} else if (toolChain in Gcc) {
linker.args "-lSDL2"
}
}
}
}
task prepare(type: Copy) {
description "Copy DLL dependencies"
from "../build/lib/"
from "src/main/resources"
into "build/binaries/mainExecutable"
}