mirror of
https://github.com/ysoftdevs/cpp-examples.git
synced 2026-01-17 00:56:49 +01:00
Update SDL build to Gradle 2.13
This commit is contained in:
@@ -1,23 +1,12 @@
|
|||||||
apply plugin: 'c'
|
apply plugin: 'c'
|
||||||
apply plugin: 'visual-studio'
|
apply plugin: 'visual-studio'
|
||||||
|
|
||||||
sources {
|
model {
|
||||||
main {
|
components {
|
||||||
c {
|
main(NativeExecutableSpec) {}
|
||||||
source {
|
|
||||||
// Include just source, avoid including *.swp and other helper files
|
|
||||||
include "**/*.c"
|
|
||||||
}
|
|
||||||
exportedHeaders {
|
|
||||||
srcDir "../build/include"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
binaries {
|
||||||
|
all {
|
||||||
executables {
|
|
||||||
main {
|
|
||||||
binaries.all {
|
|
||||||
if (toolChain in VisualCpp) {
|
if (toolChain in VisualCpp) {
|
||||||
cCompiler.args "/MD"
|
cCompiler.args "/MD"
|
||||||
linker.args "/SUBSYSTEM:CONSOLE", "/LIBPATH:../build/lib/",
|
linker.args "/SUBSYSTEM:CONSOLE", "/LIBPATH:../build/lib/",
|
||||||
|
|||||||
@@ -1,22 +1,12 @@
|
|||||||
apply plugin: 'c'
|
apply plugin: 'c'
|
||||||
apply plugin: 'visual-studio'
|
apply plugin: 'visual-studio'
|
||||||
|
|
||||||
sources {
|
model {
|
||||||
main {
|
components {
|
||||||
c {
|
main(NativeExecutableSpec) {}
|
||||||
source {
|
|
||||||
include "**/*.c"
|
|
||||||
}
|
|
||||||
exportedHeaders {
|
|
||||||
srcDir "../build/include/SDL2"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
binaries {
|
||||||
|
all {
|
||||||
executables {
|
|
||||||
main {
|
|
||||||
binaries.all {
|
|
||||||
if (toolChain in VisualCpp) {
|
if (toolChain in VisualCpp) {
|
||||||
cCompiler.args "/MD"
|
cCompiler.args "/MD"
|
||||||
linker.args "/SUBSYSTEM:CONSOLE", "/LIBPATH:../build/lib/", "SDL2main.lib", "SDL2.lib"
|
linker.args "/SUBSYSTEM:CONSOLE", "/LIBPATH:../build/lib/", "SDL2main.lib", "SDL2.lib"
|
||||||
|
|||||||
@@ -2,9 +2,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "SDL.h"
|
#include "SDL2/SDL.h"
|
||||||
// Linux build will probably need little bit different include
|
|
||||||
//#include "SDL2/SDL.h"
|
|
||||||
|
|
||||||
int main(int argc, char* argv[]) {
|
int main(int argc, char* argv[]) {
|
||||||
SDL_Window *win = NULL;
|
SDL_Window *win = NULL;
|
||||||
|
|||||||
@@ -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"
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user