43 | | universal_variant no |
| 39 | variant universal { |
| 40 | build { |
| 41 | # Build and test the library for the native architecture, |
| 42 | # just to check if everything is fine. |
| 43 | system "cd ${worksrcpath} && ${build.cmd} TestUnitTest++" |
| 44 | system "cd ${worksrcpath} && ${build.cmd} clean" |
| 45 | |
| 46 | # Now build the library for all universal architectures. |
| 47 | set lipo_args {} |
| 48 | foreach arch ${universal_archs} { |
| 49 | system "cd ${worksrcpath} && ${build.cmd} libUnitTest++.a CXXFLAGS='-arch ${arch}' LDFLAGS='-arch ${arch}'" |
| 50 | move ${worksrcpath}/libUnitTest++.a ${worksrcpath}/libUnitTest++.a.${arch} |
| 51 | system "cd ${worksrcpath} && ${build.cmd} clean" |
| 52 | lappend lipo_args -arch ${arch} ${worksrcpath}/libUnitTest++.a.${arch} |
| 53 | } |
| 54 | |
| 55 | # Roll a universal binary. |
| 56 | system "lipo ${lipo_args} -create -output ${worksrcpath}/libUnitTest++.a" |
| 57 | } |
| 58 | } |