-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
57 lines (53 loc) · 1.29 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
plugins {
id "org.sonarqube" version "3.2.0"
}
sonarqube {
properties {
property "sonar.projectKey", "optyfr_JLauncher"
property "sonar.organization", "optyfr"
property "sonar.host.url", "https://sonarcloud.io"
}
}
def os = System.getProperty("os.name").toLowerCase()
if (os.contains("windows"))
{
apply plugin: 'cpp'
apply plugin: "windows-resources"
model {
components {
JLauncher(NativeExecutableSpec) {
sources {
cpp {
source {
srcDir "JLauncher"
include "**/*.cpp"
}
}
rc {
source {
srcDir "JLauncher"
include "**/*.rc"
}
}
}
}
}
binaries {
all {
// Define a preprocessor macro for every binary
cppCompiler.define "NDEBUG"
cppCompiler.define "WIN32"
cppCompiler.define "_WINDOWS"
cppCompiler.define "UNICODE"
cppCompiler.define "_UNICODE"
// Define toolchain-specific compiler and linker options
if (toolChain in VisualCpp) {
cppCompiler.args '/GS /GL /analyze- /W3 /Gy- /Zc:wchar_t /Gm- /O1 /Ob0 /Zc:inline /fp:precise /WX- /Zc:forScope /Gd /Oy- /MT /std:c++17 /FC /EHsc /nologo /Os'
linker.args '/NXCOMPAT /OPT:REF /SAFESEH /SUBSYSTEM:WINDOWS /OPT:ICF /NOLOGO /TLBID:1 '
}
}
}
}
}
else
logger.info("Not on Windows, skipping JLauncher build.")