ld64 with ppc
[darwin-xtools.git] / cctools / CMakeLists.txt
blob7ecab4bf2016821b07085fc9ff90189abd9cc58a
2 set(CCTOOLS_VERSION_NUM 895.0)
4 add_definitions(-DALLOW_64BIT_LEB_ON_32B_TARGET=1)
6 # We need this on in the libraries as well as the apps.
7 if(XTOOLS_LTO_SUPPORT)
8   add_definitions(-DLTO_SUPPORT)
9   set(LTO_SUPPORT_INFO "(with LLVM LTO support)")
10 endif()
12 string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
14 if(uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG" )
15   add_definitions(-DDEBUG)
16 endif()
18 if(XTOOLS_BUGURL)
19   add_definitions(-DXTOOLS_BUGURL="${XTOOLS_BUGURL}")
20 endif()
22 if(PACKAGE_VERSION)
23   add_definitions(-DPACKAGE_VERSION="${PACKAGE_VERSION}")
24 endif()
26 if (XTOOLS_VERSION)
27   add_definitions(-DXTOOLS_VERSION="${XTOOLS_VERSION}")
28 endif()
30 option(CCTOOLS_EFITOOLS  "Build efitools as part of cctools" OFF)
31 option(CCTOOLS_LD_CLASSIC  "Build ld_classic as part of cctools" ON)
33 configure_file (
34   "${CMAKE_SOURCE_DIR}/cctools/cctools_version.c.in"
35   "${CMAKE_BINARY_DIR}/cctools/cctools_version.c"
36   )
38 add_subdirectory(libstuff)
39 add_subdirectory(cbtlibs)
41 if( EXISTS ${CMAKE_SOURCE_DIR}/cctools/as/CMakeLists.txt )
42   add_subdirectory(as)
43 endif()
45 if( EXISTS ${CMAKE_SOURCE_DIR}/cctools/ar/CMakeLists.txt )
46   add_subdirectory(ar)
47 endif()
49 if( EXISTS ${CMAKE_SOURCE_DIR}/cctools/misc/CMakeLists.txt )
50   add_subdirectory(misc)
51 endif()
53 if( EXISTS ${CMAKE_SOURCE_DIR}/cctools/otool/CMakeLists.txt )
54   add_subdirectory(otool)
55 endif()
57 if (CCTOOLS_LD_CLASSIC)
58   if( EXISTS ${CMAKE_SOURCE_DIR}/cctools/ld/CMakeLists.txt )
59     add_subdirectory(ld)
60   else()
61     message(WARNING "Asked to build ld_classic, but there's no CMakeList for it.")
62   endif()
63 endif()
65 if (CCTOOLS_EFITOOLS)
66   if( EXISTS ${CMAKE_SOURCE_DIR}/cctools/efitools/CMakeLists.txt )
67     add_subdirectory(efitools)
68   else()
69     message(WARNING "Asked to build efitools, but there's no CMakeList for them.")
70   endif()
71 endif()