- Last few improvements for build scripts.
This commit is contained in:
parent
7898de5f15
commit
da94176985
@ -4,8 +4,5 @@
|
|||||||
# Author: Cas Cremers
|
# Author: Cas Cremers
|
||||||
################################################################
|
################################################################
|
||||||
|
|
||||||
message (STATUS "Building Apple Mac PPC version")
|
include (BuildMacPPC.cmake)
|
||||||
set (scythername "scyther-macppc")
|
|
||||||
add_executable (${scythername} ${Scyther_sources})
|
|
||||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fnested-functions -arch ppc")
|
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
################################################################
|
################################################################
|
||||||
# Name: BuildMacIntel.cmake
|
# Name: BuildMacIntel.cmake
|
||||||
# Purpose: Build MacIntel binary on self
|
# Purpose: Build MacIntel binary
|
||||||
# Author: Cas Cremers
|
# Author: Cas Cremers
|
||||||
################################################################
|
################################################################
|
||||||
|
|
||||||
|
8
src/BuildMacPPC-MacIntel.cmake
Normal file
8
src/BuildMacPPC-MacIntel.cmake
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
################################################################
|
||||||
|
# Name: BuildMacPPC-MacIntel.cmake
|
||||||
|
# Purpose: Build MacIntel binary on MacPPC
|
||||||
|
# Author: Cas Cremers
|
||||||
|
################################################################
|
||||||
|
|
||||||
|
include (BuildMacIntel.cmake)
|
||||||
|
|
11
src/BuildMacPPC.cmake
Normal file
11
src/BuildMacPPC.cmake
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
################################################################
|
||||||
|
# Name: BuildMacPPC.cmake
|
||||||
|
# Purpose: Build MacPPC binary
|
||||||
|
# Author: Cas Cremers
|
||||||
|
################################################################
|
||||||
|
|
||||||
|
message (STATUS "Building Apple Mac PPC version")
|
||||||
|
set (scythername "scyther-macppc")
|
||||||
|
add_executable (${scythername} ${Scyther_sources})
|
||||||
|
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fnested-functions -arch ppc")
|
||||||
|
|
@ -4,10 +4,14 @@
|
|||||||
# Author: Cas Cremers
|
# Author: Cas Cremers
|
||||||
################################################################
|
################################################################
|
||||||
|
|
||||||
|
# Add target for Universal Binary when needed
|
||||||
|
if (APPLE)
|
||||||
|
include (UniversalBinary.cmake)
|
||||||
|
endif (APPLE)
|
||||||
|
|
||||||
# Retrieve Source_OS, Destination_OS (from -DTARGET)
|
# Retrieve Source_OS, Destination_OS (from -DTARGET)
|
||||||
include (GetOS.cmake)
|
include (GetOS.cmake)
|
||||||
|
|
||||||
message (STATUS "Test ${Source_OS} ${Destination_OS}")
|
|
||||||
# From source_os and destination_os make a new name for the build script
|
# From source_os and destination_os make a new name for the build script
|
||||||
if (Source_OS STREQUAL Destination_OS)
|
if (Source_OS STREQUAL Destination_OS)
|
||||||
set (BuildScriptName "Build${Source_OS}.cmake")
|
set (BuildScriptName "Build${Source_OS}.cmake")
|
||||||
|
@ -31,7 +31,7 @@ else (WIN32)
|
|||||||
endif (UNIX)
|
endif (UNIX)
|
||||||
endif (APPLE)
|
endif (APPLE)
|
||||||
endif (WIN32)
|
endif (WIN32)
|
||||||
message (STATUS "Source platform: ${Source_OS}")
|
#message (STATUS "Source platform: ${Source_OS}")
|
||||||
|
|
||||||
# Destination? If target is unset, we just take the source
|
# Destination? If target is unset, we just take the source
|
||||||
if (TARGETOS)
|
if (TARGETOS)
|
||||||
@ -39,5 +39,5 @@ if (TARGETOS)
|
|||||||
else (TARGETOS)
|
else (TARGETOS)
|
||||||
set (Destination_OS "${Source_OS}")
|
set (Destination_OS "${Source_OS}")
|
||||||
endif (TARGETOS)
|
endif (TARGETOS)
|
||||||
message (STATUS "Destination platform: ${Destination_OS}")
|
#message (STATUS "Destination platform: ${Destination_OS}")
|
||||||
|
|
||||||
|
39
src/UniversalBinary.cmake
Normal file
39
src/UniversalBinary.cmake
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
################################################################
|
||||||
|
# Name: UniversalBinary.cmake
|
||||||
|
# Purpose: Add target to make a Mac universal binary
|
||||||
|
# Needs pre-build mac versions first!
|
||||||
|
# Author: Cas Cremers
|
||||||
|
################################################################
|
||||||
|
|
||||||
|
find_program(lipoexecutable lipo)
|
||||||
|
if (lipoexecutable)
|
||||||
|
# Check whether we already have the binaries
|
||||||
|
set (requiredfiles false)
|
||||||
|
find_file (ppcfile "scyther-macppc" .)
|
||||||
|
if (ppcfile)
|
||||||
|
find_file (intelfile "scyther-macintel" .)
|
||||||
|
if (intelfile)
|
||||||
|
set (requiredfiles true)
|
||||||
|
else (intelfile)
|
||||||
|
message (FATAL_ERROR "Could not find scyther-macintel, which is required for the universal binary.")
|
||||||
|
endif (intelfile)
|
||||||
|
else (ppcfile)
|
||||||
|
message (FATAL_ERROR "Could not find scyther-macppc, which is required for the universal binary.")
|
||||||
|
endif (ppcfile)
|
||||||
|
|
||||||
|
# Use information to proceed
|
||||||
|
if (requiredfiles)
|
||||||
|
message (STATUS "Adding target for Mac universal binary")
|
||||||
|
add_custom_target (scyther-mac
|
||||||
|
COMMAND lipo -create ${ppcfile} ${intelfile} -output scyther-mac
|
||||||
|
)
|
||||||
|
else (requiredfiles)
|
||||||
|
message (STATUS "No universal binary possible yet. Please do the following:")
|
||||||
|
message (STATUS " cmake -DTARGETOS=MacPPC . && make")
|
||||||
|
message (STATUS " cmake -DTARGETOS=MacIntel . && make")
|
||||||
|
message (STATUS " cmake . && make scyther-mac")
|
||||||
|
endif (requiredfiles)
|
||||||
|
else (lipoexecutable)
|
||||||
|
message (FATAL_ERROR "Cannot find lipo program to create universal binaries")
|
||||||
|
endif (lipoexecutable)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user