--- a/hedgewars/CMakeLists.txt Sat Nov 03 22:45:24 2012 -0400
+++ b/hedgewars/CMakeLists.txt Sun Nov 04 15:43:32 2012 +0100
@@ -193,7 +193,14 @@
#this command is a workaround to some inlining issues present in older FreePascal versions and fixed in 2.6
if(fpc_version LESS "020600")
- add_custom_target(ENGINECLEAN COMMAND ${CMAKE_BUILD_TOOL} "clean" "${PROJECT_BINARY_DIR}" "${hedgewars_SOURCE_DIR}/hedgewars")
+ #under some configurations CMAKE_BUILD_TOOL fails to pass on the jobserver, breaking parallel compilation
+ #TODO: check if this is needed on windows too
+ if(UNIX)
+ set(SAFE_BUILD_TOOL $(MAKE))
+ else()
+ set(SAFE_BUILD_TOOL ${CMAKE_BUILD_TOOL})
+ endif()
+ add_custom_target(ENGINECLEAN COMMAND ${SAFE_BUILD_TOOL} "clean" "${PROJECT_BINARY_DIR}" "${hedgewars_SOURCE_DIR}/hedgewars")
endif()