Skip to content

Commit 0336bc6

Browse files
committed
Using different umodel.exe file name for different targets
1 parent c85415d commit 0336bc6

File tree

5 files changed

+26
-15
lines changed

5 files changed

+26
-15
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ umodel.cfg
3131
!.vs/tasks.vs.json
3232

3333
# Executable files and pdb
34-
umodel.pdb
34+
umodel[-_]*.exe
35+
umodel*.pdb
3536
SDL2.dll
3637
Tools/**/*.exe
3738
Tools/**/*.pdb

.vscode/c_cpp_properties.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,21 @@
1111
"name": "Win32-Debug",
1212
"customConfigurationVariables": {
1313
"BuildOptions": "--debug",
14-
"ExeName": "umodel.exe"
14+
"ExeName": "umodel-debug.exe"
1515
}
1616
},
1717
{
1818
"name": "Win64-Release",
1919
"customConfigurationVariables": {
2020
"BuildOptions": "--64",
21-
"ExeName": "umodel.exe"
21+
"ExeName": "umodel_64.exe"
2222
}
2323
},
2424
{
2525
"name": "Win64-Debug",
2626
"customConfigurationVariables": {
2727
"BuildOptions": "--64 --debug",
28-
"ExeName": "umodel.exe"
28+
"ExeName": "umodel-debug_64.exe"
2929
}
3030
}
3131
],

UmodelTool/umodel.project

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,9 @@ sources(MAIN) = {
3939
!endif
4040
}
4141

42-
target(executable, $PRJ, MAIN + COMP_LIBS + UE4_LIBS + IMG_LIBS + NV_LIBS + MOBILE_LIBS, MAIN)
42+
!if !defined(EXE_NAME)
43+
EXE_NAME = $PRJ
44+
!message NO EXE_NAME
45+
!endif
46+
47+
target(executable, $EXE_NAME, MAIN + COMP_LIBS + UE4_LIBS + IMG_LIBS + NV_LIBS + MOBILE_LIBS, MAIN)

build.sh

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,18 @@ function DebugPrint()
4646
}
4747

4848
#-------------------------------------------------------------
49-
# Setup default project when running this script directly
49+
# Setup default project when running this script directly. Used to build UmodelTool.
5050

5151
function SetupDefaultProject()
5252
{
53-
[ "$project" ] || project="UmodelTool/umodel" # setup default project name
54-
[ "$root" ] || root="."
55-
[ "$render" ] || render=1
53+
project="UmodelTool/umodel"
54+
root="."
55+
render=1
56+
local ExeName="umodel"
57+
[ "$debug" ] && ExeName+="-debug"
58+
[ "$profile" ] && ExeName+="-profile"
59+
[ "$PLATFORM" == "vc-win64" ] && ExeName+="_64"
60+
GENMAKE_OPTIONS+=" EXE_NAME=$ExeName"
5661
}
5762

5863
#-------------------------------------------------------------
@@ -123,7 +128,7 @@ function DetectVisualStudioVersion()
123128
# Adjust vc_ver to found one
124129
vc_ver=$found_vc_year
125130
DebugPrint "Found: Visual Studio $found_vc_year at \"$workpath\", Version = $vc_ver"
126-
GENMAKE_OPTIONS=VC_VER=$vc_ver # specify compiler for genmake script
131+
GENMAKE_OPTIONS+=" VC_VER=$vc_ver" # specify compiler for genmake script
127132
}
128133

129134
#-------------------------------------------------------------
@@ -224,7 +229,7 @@ EOF
224229

225230
#-------------------------------------------------------------
226231

227-
SetupDefaultProject
232+
[ "$project" ] || SetupDefaultProject
228233
GetBuildNumber
229234
DetectBuildPlatform
230235

common.project

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ LIBC = shared
44
#MAPFILES = 1
55
CONSOLE = 1
66

7-
!if !defined($OPTIMIZE) # allow overriding of OPTIMIZE in parent project
7+
!if !defined(OPTIMIZE) # allow overriding of OPTIMIZE in parent project
88
OPTIMIZE = size
99
!endif
1010

1111
PDB = 2 # keep enabled, executable is almost the same, except embedded link to pdb file
1212

13-
!if !defined($OLDCRT) # allow overriding of OLDCRT in parent project
13+
!if !defined(OLDCRT) # allow overriding of OLDCRT in parent project
1414
OLDCRT = 0 # set to 0 (or comment the line) to use "native" compiler's CRT
1515
# Changed 29.05.2021: Oodle static libraries requires more modern CRT which is not available in MSVCRT.dll
1616
!endif
@@ -33,7 +33,7 @@ CPP_STD = c++14 # allow modern C++ features
3333
#!! todo: the standard has been changed for clang on macOS, check for "CPP_STD" below!
3434

3535
!if "$COMPILER" eq "VisualC"
36-
!if !defined($CPP_EXCEPT)
36+
!if !defined(CPP_EXCEPT)
3737
CPP_EXCEPT = 0 # used with WIN32_USE_SEH in Core.h
3838
!endif
3939
WINXP = 1 # we're not using any modern Win32 features, so allow to worn at WinXP
@@ -198,7 +198,7 @@ STDLIBS += SDL2 # disabled in macOS build
198198
INCLUDES += . $R/Core $R/Unreal $LIBINCLUDES
199199
OPTIONS += $WARNINGS
200200

201-
!if defined($DEBUG)
201+
!if defined(DEBUG)
202202
DEFINES += MAX_DEBUG
203203
OBJDIR = $OBJDIR-debug
204204
OPTIMIZE = none

0 commit comments

Comments
 (0)