-
Notifications
You must be signed in to change notification settings - Fork 3
/
linkControl.nim
40 lines (37 loc) · 1.13 KB
/
linkControl.nim
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
switch "app","gui" # dismiss background Window
#---------------------------------------
# Select static link or shared/dll link
#---------------------------------------
when defined(windows):
const STATIC_LINK_GLFW = true
const STATIC_LINK_CC = true #libstd++ or libc
if TC == "vcc":
switch "passL","d3d9.lib kernel32.lib user32.lib gdi32.lib winspool.lib"
switch "passL","comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib"
switch "passL","uuid.lib odbc32.lib odbccp32.lib"
switch "passL","imm32.lib"
else:
switch "passL","-lgdi32 -limm32 -lcomdlg32 -luser32 -lshell32"
else: # for Linux
const STATIC_LINK_GLFW = false
const STATIC_LINK_CC= false
#
when STATIC_LINK_GLFW: # GLFW static link
switch "define","glfwStaticLib"
else: # shared/dll
when defined(windows):
if TC == "vcc":
discard
else:
switch "passL","-lglfw3"
switch "define", "glfwDLL"
#switch "define","cimguiDLL"
else:
switch "passL","-lglfw"
when STATIC_LINK_CC: # gcc static link
case TC
of "vcc":
discard
else:
switch "passC", "-static"
switch "passL", "-static "