Skip to content

Commit 5c5241c

Browse files
committed
FEAT: added block with define flags into make-settings so one could use these in the compilation using generated makefile
1 parent 3b0f7ae commit 5c5241c

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

make/make-settings.r

+9
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,12 @@ REBOL [
44

55
TOOLS-Win32: "x:/MingW/mingw32/bin/"
66
TOOLS-Win64: "x:/MingW/mingw64/bin/"
7+
8+
;@@ If you add or remove some of these defines bellow, you should `make clean`
9+
;@@ to make sure that all affected files will be recompiled!
10+
Defines: [
11+
USE_BMP_CODEC
12+
USE_PNG_CODEC
13+
USE_GIF_CODEC
14+
USE_JPG_CODEC
15+
]

src/tools/make-make.r

+14-2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ path-host: %../os/
2626
path-make: %../../make/
2727
path-incl: %../../src/include/
2828

29+
settings: attempt [load path-make/make-settings.r]
30+
2931
;******************************************************************************
3032

3133
; (Warning: format is a bit sensitive to extra spacing. E.g. see macro+ func)
@@ -81,10 +83,11 @@ RES=
8183
RAPI_FLAGS=
8284
HOST_FLAGS= -DREB_EXE
8385
RLIB_FLAGS=
86+
USE_FLAGS=
8487
8588
# Flags for core and for host:
86-
RFLAGS= -c -D$(TO_OS) -DREB_API $(RAPI_FLAGS) $I
87-
HFLAGS= -c -D$(TO_OS) -DREB_CORE $(HOST_FLAGS) $I
89+
RFLAGS= -c -D$(TO_OS) -DREB_API $(RAPI_FLAGS) $(USE_FLAGS) $I
90+
HFLAGS= -c -D$(TO_OS) -DREB_CORE $(HOST_FLAGS) $(USE_FLAGS) $I
8891
CLIB=
8992
9093
# REBOL is needed to build various include files:
@@ -412,6 +415,15 @@ unless flag? -SP [ ; Use standard paths:
412415
macro+ UP ".."
413416
macro+ CD "./"
414417
]
418+
419+
if all [settings block? settings/defines][
420+
flags: copy ""
421+
foreach flag settings/defines [
422+
append flags join " -D" flag
423+
]
424+
macro+ USE_FLAGS flags
425+
]
426+
415427
;Oldes: Why there was the next line?
416428
;if os-plat/2 = 3 [macro+ REBOL ">NUL:"] ; Temporary workaround for R3 on Win7.
417429
either flag? EXE [

0 commit comments

Comments
 (0)