Force Make into using a single thread

This also restricts fast-vapi's to Ninja. fast-vapi's improve build
performance when multi-threaded, but are bad when single-threaded.

Again emphasize that ninja-build should be used.
This commit is contained in:
Marvin W 2017-03-12 19:31:02 +01:00
parent fabd6ff251
commit 4f34e43116
No known key found for this signature in database
GPG key ID: 072E9235DB996F2A
2 changed files with 9 additions and 4 deletions

View file

@ -118,7 +118,9 @@ function(vala_precompile output)
cmake_parse_arguments(ARGS "FAST_VAPI" "DIRECTORY;GENERATE_HEADER;GENERATE_VAPI;EXPORTS_DIR" cmake_parse_arguments(ARGS "FAST_VAPI" "DIRECTORY;GENERATE_HEADER;GENERATE_VAPI;EXPORTS_DIR"
"SOURCES;PACKAGES;OPTIONS;DEFINITIONS;CUSTOM_VAPIS;GRESOURCES" ${ARGN}) "SOURCES;PACKAGES;OPTIONS;DEFINITIONS;CUSTOM_VAPIS;GRESOURCES" ${ARGN})
if("Ninja" STREQUAL ${CMAKE_GENERATOR})
set(ARGS_FAST_VAPI true) set(ARGS_FAST_VAPI true)
endif()
if(ARGS_DIRECTORY) if(ARGS_DIRECTORY)
get_filename_component(DIRECTORY ${ARGS_DIRECTORY} ABSOLUTE) get_filename_component(DIRECTORY ${ARGS_DIRECTORY} ABSOLUTE)
@ -274,7 +276,7 @@ function(vala_precompile output)
${ARGS_CUSTOM_VAPIS} ${ARGS_CUSTOM_VAPIS}
${ARGS_GRESOURCES} ${ARGS_GRESOURCES}
COMMENT COMMENT
"Generating VAPI and headers for linking" "Generating VAPI and headers for target ${output}"
) )
endif() endif()
else(ARGS_FAST_VAPI) else(ARGS_FAST_VAPI)

7
configure vendored
View file

@ -34,10 +34,9 @@ if ! [ -x "$exec_bin" ]; then
make_bin="$(which make 2>/dev/null)" make_bin="$(which make 2>/dev/null)"
if [ -x "$make_bin" ]; then if [ -x "$make_bin" ]; then
echo "-- Found Make: $make_bin" echo "-- Found Make: $make_bin"
echo "-- Using Ninja (ninja-build) might improve build experience."
cmake_type="Unix Makefiles" cmake_type="Unix Makefiles"
exec_bin="$make_bin" exec_bin="$make_bin"
exec_command="$exec_bin -j4" exec_command="$exec_bin"
fi fi
fi fi
@ -95,3 +94,7 @@ default:
%: %:
@sh -c "cd build; $exec_command \"\$@\"" @sh -c "cd build; $exec_command \"\$@\""
EOF EOF
if [[ "$exec_bin" == "$make_bin" ]]; then
echo "-- Running with make. Using Ninja (ninja-build) might improve build experience."
fi