bmx-ng / bmk

The enhanced BlitzMax build program.
zlib License
28 stars 13 forks source link

Framework commands in import files not leading to warnings/errors #107

Open GWRon opened 3 years ago

GWRon commented 3 years ago

test.bmx

SuperStrict
Framework Brl.StandardIO
Import "test_framework.bmx"

Print "Hello World"

test_framework.bmx

SuperStrict
Framework Brl.GLMax2D

Type TTest
End Type

Compiling "test.bmx" leads to

Building test
[100%] Linking:test.debug
/bmx tests/framework/.bmx/test_framework.bmx.debug.linux.x64.o: In Funktion »_bb_framework_test_framework«:
/bmx tests/framework/test_framework.bmx:46: Warnung: undefinierter Verweis auf »__bb_brl_glmax2d_glmax2d«
collect2: error: ld returned 1 exit status
Build Error: Failed to link /bmx tests/framework/test.debug

Shouldn't it better add a warning / error about framework being used twice? I understand that it is not easily done as the intermediate file of "test_framework.bmx" does not expose (via filename) that a framework command is in use there. the file "test_framework.bmx" itself is valid (and could compiled on its own).

Yet it mixes in at the end with https://github.com/bmx-ng/bmx-ng/issues/89 anyways ... if multiple imports were done (A importing B importing C) - so only the special mix "test imports test_framework.bmx" would work flawlessly (except in "rebuild" mode).