Skip to content
Snippets Groups Projects
Commit 218ebf0f authored by Andreas Traczyk's avatar Andreas Traczyk
Browse files

tooling: Windows: propagate failure from the CMakeLists.txt

Also don't install pywinmake from the CMakeLists.txt.

Change-Id: Idf77fa95e1166561c809fba50b867a07d3358a83
parent 7f5fa093
No related branches found
No related tags found
No related merge requests found
...@@ -116,10 +116,16 @@ if (BUILD_CONTRIB) ...@@ -116,10 +116,16 @@ if (BUILD_CONTRIB)
WORKING_DIRECTORY ${CONTRIB_BUILD_PATH}) WORKING_DIRECTORY ${CONTRIB_BUILD_PATH})
else() else()
set(SCRIPTS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/extras/scripts) set(SCRIPTS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/extras/scripts)
execute_process(COMMAND python -m pip install ${SCRIPTS_DIR}/pywinmake)
execute_process( execute_process(
COMMAND python ${SCRIPTS_DIR}/winmake.py COMMAND python ${SCRIPTS_DIR}/winmake.py
WORKING_DIRECTORY ${SCRIPTS_DIR}) WORKING_DIRECTORY ${SCRIPTS_DIR}
RESULT_VARIABLE BUILD_RESULT
)
if (BUILD_RESULT)
message(FATAL_ERROR "Contrib build failed.")
else()
message(STATUS "Contrib build successful.")
endif()
endif() endif()
endif() endif()
......
...@@ -11,6 +11,7 @@ import os ...@@ -11,6 +11,7 @@ import os
import time import time
from datetime import timedelta from datetime import timedelta
import argparse import argparse
import sys
from pywinmake.utils import log, logger, sh_exec from pywinmake.utils import log, logger, sh_exec
from pywinmake.package import Versioner, Paths, Operation, Package from pywinmake.package import Versioner, Paths, Operation, Package
...@@ -77,7 +78,11 @@ def build_from_dir(path, out_dir=None): ...@@ -77,7 +78,11 @@ def build_from_dir(path, out_dir=None):
# Build the package at the given path. # Build the package at the given path.
out_dir = os.path.join(path, "build") if out_dir is None else out_dir out_dir = os.path.join(path, "build") if out_dir is None else out_dir
pkg = Package(src_dir=path, buildsrc_dir=out_dir) pkg = Package(src_dir=path, buildsrc_dir=out_dir)
builder.build(pkg) if builder.build(pkg):
log.info(f"Package {pkg.name} built successfully.")
else:
log.error(f"Package {pkg.name} failed to build.")
sys.exit(1)
def main(): def main():
start_time = time.time() start_time = time.time()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment