all repos — mgba @ f116713f2eb6303f8efef8370b033efd3c97e23a

mGBA Game Boy Advance Emulator

Python: Fix build in some cases
Vicki Pfau vi@endrift.com
Tue, 18 Apr 2017 17:26:30 -0700
commit

f116713f2eb6303f8efef8370b033efd3c97e23a

parent

b65992a1b8dbc6b8309cce8030fe734c4755d71a

1 files changed, 6 insertions(+), 1 deletions(-)

jump to
M src/platform/python/CMakeLists.txtsrc/platform/python/CMakeLists.txt

@@ -2,8 +2,13 @@ find_program(PYTHON python)

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/setup.py.in ${CMAKE_CURRENT_BINARY_DIR}/setup.py) +get_property(INCLUDE_DIRECTORIES DIRECTORY PROPERTY INCLUDE_DIRECTORIES) +set(INCLUDE_FLAGS) +foreach(DIR IN LISTS INCLUDE_DIRECTORIES) + list(APPEND INCLUDE_FLAGS "-I${DIR}") +endforeach() add_custom_command(OUTPUT build/lib/${BINARY_NAME}/__init__.py - COMMAND BINDIR=${CMAKE_CURRENT_BINARY_DIR}/.. ${PYTHON} ${CMAKE_CURRENT_BINARY_DIR}/setup.py build --build-base ${CMAKE_CURRENT_BINARY_DIR} + COMMAND BINDIR=${CMAKE_CURRENT_BINARY_DIR}/.. CPPFLAGS="${INCLUDE_FLAGS}" ${PYTHON} ${CMAKE_CURRENT_BINARY_DIR}/setup.py build --build-base ${CMAKE_CURRENT_BINARY_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DEPENDS ${BINARY_NAME} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/setup.py