blob: 1aea4f212c5e63eb5c587ee420d339953117f9df [file] [log] [blame]
# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set(TARGET_OS OSX)
if(PREBUILTS)
set(COMPILER_PATH "${PREBUILTS}/clang/darwin-x86/sdk/3.5")
list(APPEND CMAKE_PREFIX_PATH "${COMPILER_PATH}/bin")
include (CMakeForceCompiler)
CMAKE_FORCE_C_COMPILER("${COMPILER_PATH}/bin/clang" GNU)
CMAKE_FORCE_CXX_COMPILER("${COMPILER_PATH}/bin/clang++" GNU)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -fPIC")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -stdlib=libc++ -dynamiclib")
endif()