other tweaks for mac compilation
authorkoda
Sat, 28 Nov 2009 02:46:15 +0000
changeset 2644 52b7c4776af9
parent 2643 2074393d4db7
child 2645 89aa2aa89066
other tweaks for mac compilation
CMakeLists.txt
hedgewars/CMakeLists.txt
--- a/CMakeLists.txt	Thu Nov 26 18:43:33 2009 +0000
+++ b/CMakeLists.txt	Sat Nov 28 02:46:15 2009 +0000
@@ -44,10 +44,16 @@
 	IF(BUNDLE)
 		if(current_macosx_version MATCHES "10.6")
 			set(CMAKE_OSX_ARCHITECTURES "x86_64;i386;ppc7400")
-			set(build_64_universal TRUE)		
+			set(build_x86_64 TRUE)		
+			set(build_i386 TRUE)		
+			set(build_ppc TRUE)		
 		else()
 			set(CMAKE_OSX_ARCHITECTURES "i386;ppc7400")
+			set(build_i386 TRUE)		
+			set(build_ppc TRUE)	
 		endif()
+	ELSE()
+		set(build_i386 TRUE)
 	ENDIF()	
 
 	message(STATUS "Target system: Mac OS X ${minimum_macosx} for ${CMAKE_OSX_ARCHITECTURES}")	
--- a/hedgewars/CMakeLists.txt	Thu Nov 26 18:43:33 2009 +0000
+++ b/hedgewars/CMakeLists.txt	Sat Nov 28 02:46:15 2009 +0000
@@ -85,7 +85,7 @@
 	if (fpc_ver LESS "020200")
 		message(FATAL_ERROR "Minimum required version of FreePascal is 2.2.0")
 	else()
-		if (APPLE AND build_64_universal AND fpc_ver LESS "020400")
+		if (APPLE AND build_x86_64 AND fpc_ver LESS "020400")
 			message(FATAL_ERROR "Minimum required version of FreePascal is 2.4.0 for building 64 bit applications")
 		endif()
 		set(pascal_compiler ${fpc_executable})
@@ -127,7 +127,15 @@
 		)
 ELSE()
 #these are the dependencies for building a universal binary on Mac OS X
-	set(lipo_args_list "${EXECUTABLE_OUTPUT_PATH}/hwengine.386" "${EXECUTABLE_OUTPUT_PATH}/hwengine.ppc")
+	if(build_ppc)
+		set(lipo_args_list "${EXECUTABLE_OUTPUT_PATH}/hwengine.ppc" ${lipo_args_list})
+	endif()
+	if(build_i386)
+		set(lipo_args_list "${EXECUTABLE_OUTPUT_PATH}/hwengine.386" ${lipo_args_list})
+	endif()
+	if(build_x86_64)
+		set(lipo_args_list "${EXECUTABLE_OUTPUT_PATH}/hwengine.x64" ${lipo_args_list})
+	endif()
 
 	add_custom_command(OUTPUT "${EXECUTABLE_OUTPUT_PATH}/hwengine.386"
 		COMMAND "${pascal_compiler}" 
@@ -145,17 +153,13 @@
 		)
 	add_custom_target(hwengine.ppc ALL DEPENDS "${EXECUTABLE_OUTPUT_PATH}/hwengine.ppc")
 
-	IF(build_64_universal)
-		set(lipo_args_list "${EXECUTABLE_OUTPUT_PATH}/hwengine.x64" ${lipo_args_list})
-	
-		add_custom_command(OUTPUT "${EXECUTABLE_OUTPUT_PATH}/hwengine.x64"
-			COMMAND "${pascal_compiler}" 
-			ARGS ${pascal_compiler_flags} -ohwengine.x64 -Px86_64
-			MAIN_DEPENDENCY ${hwengine_project}
-			DEPENDS ${engine_sources}
-			)
-		add_custom_target(hwengine.x64 ALL DEPENDS "${EXECUTABLE_OUTPUT_PATH}/hwengine.x64")
-	ENDIF()
+	add_custom_command(OUTPUT "${EXECUTABLE_OUTPUT_PATH}/hwengine.x64"
+		COMMAND "${pascal_compiler}" 
+		ARGS ${pascal_compiler_flags} -ohwengine.x64 -Px86_64
+		MAIN_DEPENDENCY ${hwengine_project}
+		DEPENDS ${engine_sources}
+		)
+	add_custom_target(hwengine.x64 ALL DEPENDS "${EXECUTABLE_OUTPUT_PATH}/hwengine.x64")
 
 	add_custom_command(OUTPUT "${EXECUTABLE_OUTPUT_PATH}/hwengine"
 		COMMAND "lipo"