hedgewars/CMakeLists.txt
branch0.9.18
changeset 7940 d5e49cf042d9
parent 7817 6cc558a69b58
child 7942 17b3937de37b
--- 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()