-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathJamrules
102 lines (88 loc) · 2.53 KB
/
Jamrules
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
##
## Compilation
##
C++ = clang++ ;
LINK = clang++ ;
# C++ = g++ ;
# LINK = g++ ;
if $(UNIX) { SUFSHR = .so ; }
else if $(NT) { SUFSHR = .dll ; }
if $(CROSS_COMPILE_WINDOWS)
{
C++ = x86_64-w64-mingw32-g++ ;
LINK = x86_64-w64-mingw32-g++ ;
AR = x86_64-w64-mingw32-ar ;
SUFEXE = .exe ;
OS_DEPENDENT_C++FLAGS = -DWINDOWS ;
OS_DEPENDENT_LINKLIBS = ;
OS_DEPENDENT_LINKFLAGS = --export-all-symbols ;
MINGW_LIB_PATH = /usr/lib/gcc/x86_64-w64-mingw32/7.3-win32 ;
OS_DEPENDENT_DLLS =
$(MINGW_LIB_PATH)/libgcc_s_seh-1.dll
$(MINGW_LIB_PATH)/libstdc++-6.dll ;
}
else if $(UNIX)
{
OS_DEPENDENT_C++FLAGS = -DUNIX ;
# For dynamic loading: ldl loads, export-dynamic lets the loaded code resolve its symbols to the loader's code
OS_DEPENDENT_LINKLIBS = -ldl ;
OS_DEPENDENT_LINKFLAGS = --export-dynamic ;
OS_DEPENDENT_DLLS = ;
}
else if $(NT)
{
OS_DEPENDENT_C++FLAGS = -DWINDOWS ;
# TODO: Windows support
OS_DEPENDENT_LINKLIBS = ;
OS_DEPENDENT_LINKFLAGS = ;
OS_DEPENDENT_DLLS = ;
}
# Arguments used on all projects, regardless of any variables
C++FLAGS = -std=c++11 -Wall -Wextra -Wno-unused-parameter
# Only for profiling, i.e. not release builds
# -DTRACY_ENABLE
-g
# Needed for dynamic linking
-fPIC
$(OS_DEPENDENT_C++FLAGS)
;
# TODO: Make base hold all this weirdness?
# if $(DEBUG_BUILD)
# {
# SFML_LINKLIBS = -lsfml-audio-d -lsfml-graphics-d -lsfml-window-d -lsfml-system-d ;
# }
# else
# {
# SFML_LINKLIBS = -lsfml-audio -lsfml-graphics -lsfml-window -lsfml-system ;
# }
OPTIM = -O0 ;
##
## Linking
##
LINKLIBS =
# Standard (e.g. for Tracy)
-lpthread
# Functions for dynamically loading libraries (UNIX)
$(OS_DEPENDENT_LINKLIBS)
;
LINKFLAGS = -g
# -Wl = pass to linker
# --export-dynamic = Export all symbols so dynamically loaded code can resolve their symbols to ours
-Wl,-rpath,.,$(OS_DEPENDENT_LINKFLAGS)
;
##
## Jam stuff
##
# Fix for unnecessary rebuilding any Jam project
KEEPOBJS = true ; # This doesn't actually fix anything, though it seems like it should
NOARSCAN = true ; # This actually fixes the problem
#AR = ar rUu ; # I was thinking maybe the AR command was wrong (always outputting deterministically)
# It doesn't seem like this is the problem though
AR = ar cr ;
# Some helpful Jam commands
# -q : stop on failed target
# -jN : use N cores
# -sVAR=VAL : Set VAR to VAL. Note that setting WINDOWS=false is the same as setting WINDOWS=true,
# frustratingly (as if it's an ifdef not an if x = y
# -dx : print commands being used
# -n : don't actually run commands