/apps/twnlua: support dynlib game=off
This commit is contained in:
		| @@ -8,9 +8,13 @@ endif() | ||||
|  | ||||
| add_subdirectory($ENV{TWNROOT} $ENV{TWNROOT}/build) | ||||
|  | ||||
| set(FLAGS | ||||
|         $<$<NOT:$<BOOL:${TWN_FEATURE_DYNLIB_GAME}>>:--no-dynlib-game> | ||||
| ) | ||||
|  | ||||
| add_custom_command( | ||||
|    OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/luabind.c | ||||
|    COMMAND ${PYTHON3} ${CMAKE_CURRENT_SOURCE_DIR}/bindgen.py $ENV{TWNROOT}/share/twn_api.json > ${CMAKE_CURRENT_SOURCE_DIR}/luabind.c | ||||
|    COMMAND ${PYTHON3} ${CMAKE_CURRENT_SOURCE_DIR}/bindgen.py $ENV{TWNROOT}/share/twn_api.json ${FLAGS} > ${CMAKE_CURRENT_SOURCE_DIR}/luabind.c | ||||
|    DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bindgen.py $ENV{TWNROOT}/share/twn_api.json | ||||
| ) | ||||
|  | ||||
| @@ -23,5 +27,4 @@ set(SOURCE_FILES | ||||
|         ${CMAKE_CURRENT_SOURCE_DIR}/luabind.c | ||||
| ) | ||||
|  | ||||
|  | ||||
| use_townengine(${PROJECT_NAME} "${SOURCE_FILES}" ${CMAKE_SOURCE_DIR}) | ||||
|   | ||||
| @@ -64,8 +64,8 @@ def from_table(typedesc, variable, indent = 0): | ||||
|  | ||||
|  | ||||
| print('#include "twn_game_api.h"\n') | ||||
| # TODO: reuse implementation from the engine, this also breaks with statically compiled build | ||||
| print('#define STB_DS_IMPLEMENTATION') | ||||
| if not "--no-dynlib-game" in sys.argv: | ||||
|     print('#define STB_DS_IMPLEMENTATION') | ||||
| print('#include <stb_ds.h>') | ||||
| print('#include "minilua.h"\n') | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user