cmake_modules/platform.cmake
branch0.9.20
changeset 9911 9a8fe10c1ecf
parent 9899 5b8bde62a8ef
child 9913 18b883180dd5
equal deleted inserted replaced
9909:b2e868026bb0 9911:9a8fe10c1ecf
    71         add_flag_prepend(CMAKE_Pascal_FLAGS -Px86_64)
    71         add_flag_prepend(CMAKE_Pascal_FLAGS -Px86_64)
    72     endif()
    72     endif()
    73 
    73 
    74     #CMAKE_OSX_SYSROOT is set at the system version we are supposed to build on
    74     #CMAKE_OSX_SYSROOT is set at the system version we are supposed to build on
    75     #we need to provide the correct one when host and target differ
    75     #we need to provide the correct one when host and target differ
    76     if(NOT ${minimum_macosx_version} VERSION_EQUAL ${current_macosx_version})
    76     if(NOT CMAKE_OSX_SYSROOT AND
       
    77        NOT ${minimum_macosx_version} VERSION_EQUAL ${current_macosx_version})
    77         find_program(xcrun xcrun)
    78         find_program(xcrun xcrun)
    78         if(xcrun)
    79         if(xcrun)
    79             execute_process(COMMAND ${xcrun} "--show-sdk-path"
    80             execute_process(COMMAND ${xcrun} "--show-sdk-path"
    80                             OUTPUT_VARIABLE current_sdk_path
    81                             OUTPUT_VARIABLE current_sdk_path
    81                             OUTPUT_STRIP_TRAILING_WHITESPACE)
    82                             OUTPUT_STRIP_TRAILING_WHITESPACE)
    82             string(REPLACE "${current_macosx_version}"
    83             string(REPLACE "${current_macosx_version}"
    83                            "${minimum_macosx_version}"
    84                            "${minimum_macosx_version}"
    84                            CMAKE_OSX_SYSROOT
    85                            CMAKE_OSX_SYSROOT
    85                            "${current_sdk_path}")
    86                            "${current_sdk_path}")
    86 
       
    87             add_flag_append(CMAKE_Pascal_FLAGS "-XR${CMAKE_OSX_SYSROOT}")
       
    88             add_flag_append(CMAKE_Pascal_FLAGS "-k-macosx_version_min -k${minimum_macosx_version}")
       
    89         else()
    87         else()
    90             message("*** xcrun not found! Build will work on ${current_macosx_version} only ***")
    88             message("*** xcrun not found! Build will work on ${current_macosx_version} only ***")
    91         endif()
    89         endif()
       
    90     endif()
       
    91     if(CMAKE_OSX_SYSROOT)
       
    92         add_flag_append(CMAKE_Pascal_FLAGS "-XR${CMAKE_OSX_SYSROOT}")
       
    93         add_flag_append(CMAKE_Pascal_FLAGS "-k-macosx_version_min -k${minimum_macosx_version}")
    92     endif()
    94     endif()
    93 
    95 
    94     #add user framework directory
    96     #add user framework directory
    95     add_flag_append(CMAKE_Pascal_FLAGS "-Ff~/Library/Frameworks")
    97     add_flag_append(CMAKE_Pascal_FLAGS "-Ff~/Library/Frameworks")
    96 
    98