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