1cmake_minimum_required(VERSION 3.6) 2project(surfaceflinger) 3set(ANDROID_ROOT ../../../../../../../../..) 4set(SURFACEFLINGER_ROOT ${ANDROID_ROOT}/frameworks/native/services/surfaceflinger) 5 6set(CMAKE_C_COMPILER "${ANDROID_ROOT}/prebuilts/clang/host/linux-x86/clang-3289846/bin/clang") 7set(CMAKE_CXX_COMPILER "${ANDROID_ROOT}/prebuilts/clang/host/linux-x86/clang-3289846/bin/clang++") 8 9set(SOURCE_FILES 10 ${SURFACEFLINGER_ROOT}/DisplayHardware/FramebufferSurface.cpp 11 ${SURFACEFLINGER_ROOT}/DisplayHardware/PowerHAL.cpp 12 ${SURFACEFLINGER_ROOT}/DisplayHardware/VirtualDisplaySurface.cpp 13 ${SURFACEFLINGER_ROOT}/DisplayHardware/HWC2On1Adapter.cpp 14 ${SURFACEFLINGER_ROOT}/Effects/Daltonizer.cpp 15 ${SURFACEFLINGER_ROOT}/EventLog/EventLog.cpp 16 ${SURFACEFLINGER_ROOT}/RenderEngine/Description.cpp 17 ${SURFACEFLINGER_ROOT}/RenderEngine/GLES20RenderEngine.cpp 18 ${SURFACEFLINGER_ROOT}/RenderEngine/GLExtensions.cpp 19 ${SURFACEFLINGER_ROOT}/RenderEngine/Mesh.cpp 20 ${SURFACEFLINGER_ROOT}/RenderEngine/Program.cpp 21 ${SURFACEFLINGER_ROOT}/RenderEngine/ProgramCache.cpp 22 ${SURFACEFLINGER_ROOT}/RenderEngine/RenderEngine.cpp 23 ${SURFACEFLINGER_ROOT}/RenderEngine/Texture.cpp 24 ${SURFACEFLINGER_ROOT}/Client.cpp 25 ${SURFACEFLINGER_ROOT}/DdmConnection.cpp 26 ${SURFACEFLINGER_ROOT}/DisplayDevice.cpp 27 ${SURFACEFLINGER_ROOT}/DispSync.cpp 28 ${SURFACEFLINGER_ROOT}/EventControlThread.cpp 29 ${SURFACEFLINGER_ROOT}/EventThread.cpp 30 ${SURFACEFLINGER_ROOT}/FrameTracker.cpp 31 ${SURFACEFLINGER_ROOT}/GpuService.cpp 32 ${SURFACEFLINGER_ROOT}/Layer.cpp 33 ${SURFACEFLINGER_ROOT}/LayerDim.cpp 34 ${SURFACEFLINGER_ROOT}/LayerRejecter.cpp 35 ${SURFACEFLINGER_ROOT}/main_surfaceflinger.cpp 36 ${SURFACEFLINGER_ROOT}/MessageQueue.cpp 37 ${SURFACEFLINGER_ROOT}/MonitoredProducer.cpp 38 ${SURFACEFLINGER_ROOT}/SurfaceFlingerConsumer.cpp 39 ${SURFACEFLINGER_ROOT}/SurfaceInterceptor.cpp 40 ${SURFACEFLINGER_ROOT}/Transform.cpp 41 ) 42 43set(USE_HWC2 1) 44 45if (USE_HWC2) 46 list(APPEND SOURCE_FILES "${SURFACEFLINGER_ROOT}/DisplayHardware/ComposerHal.cpp") 47 list(APPEND SOURCE_FILES "${SURFACEFLINGER_ROOT}/SurfaceFlinger.cpp") 48 list(APPEND SOURCE_FILES "${SURFACEFLINGER_ROOT}/DisplayHardware/HWC2.cpp") 49 list(APPEND SOURCE_FILES "${SURFACEFLINGER_ROOT}/DisplayHardware/HWComposer.cpp") 50 51 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBYPASS_IHWC") 52 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_HWC2") 53else() 54 list(APPEND SOURCE_FILES "${SURFACEFLINGER_ROOT}/SurfaceFlinger_hwc1.cpp") 55 list(APPEND SOURCE_FILES "${SURFACEFLINGER_ROOT}/DisplayHardware/HWComposer_hwc1.cpp") 56 list(APPEND SOURCE_FILES "${SURFACEFLINGER_ROOT}/DisplayHardware/HWComposer_hwc1.cpp") 57endif() 58 59# GLOBAL FLAGS: 60# parameters: '${config.CommonGlobalIncludes} ${config.CommonGlobalSystemIncludes} ${config.Arm64IncludeFlags} ${config.CommonNativehelperInclude} -Iframeworks/native/libs/ui ${config.Arm64ClangCflags} ${config.CommonClangGlobalCflags} ${config.DeviceClangGlobalCflags} ${config.Arm64ClangCortexA53Cflags} -Isystem/libhidl/base/include -Isystem/core/base/include -Isystem/libhidl/transport/include -Isystem/core/base/include -Isystem/libhidl/base/include -Isystem/core/base/include -Iout/soong/.intermediates/system/libhidl/transport/manager/1.0/android.hidl.manager@1.0_genc++_headers/gen -Iout/soong/.intermediates/system/libhidl/transport/base/1.0/android.hidl.base@1.0_genc++_headers/gen -Isystem/libhwbinder/include -Isystem/core/base/include -Isystem/libhidl/base/include -Isystem/core/base/include -Isystem/libhidl/transport/include -Isystem/core/base/include -Isystem/libhidl/base/include -Isystem/core/base/include -Iout/soong/.intermediates/system/libhidl/transport/manager/1.0/android.hidl.manager@1.0_genc++_headers/gen -Iout/soong/.intermediates/system/libhidl/transport/base/1.0/android.hidl.base@1.0_genc++_headers/gen -Isystem/libhwbinder/include -Isystem/core/base/include -Iout/soong/.intermediates/hardware/interfaces/graphics/common/1.0/android.hardware.graphics.common@1.0_genc++_headers/gen -Isystem/libhidl/base/include -Isystem/core/base/include -Isystem/libhidl/transport/include -Isystem/core/base/include -Isystem/libhidl/base/include -Isystem/core/base/include -Iout/soong/.intermediates/system/libhidl/transport/manager/1.0/android.hidl.manager@1.0_genc++_headers/gen -Iout/soong/.intermediates/system/libhidl/transport/base/1.0/android.hidl.base@1.0_genc++_headers/gen -Isystem/libhwbinder/include -Isystem/core/base/include -Iout/soong/.intermediates/system/libhidl/transport/base/1.0/android.hidl.base@1.0_genc++_headers/gen -Iout/soong/.intermediates/hardware/interfaces/graphics/allocator/2.0/android.hardware.graphics.allocator@2.0_genc++_headers/gen -Isystem/libhidl/base/include -Isystem/core/base/include -Isystem/libhidl/transport/include -Isystem/core/base/include -Isystem/libhidl/base/include -Isystem/core/base/include -Iout/soong/.intermediates/system/libhidl/transport/manager/1.0/android.hidl.manager@1.0_genc++_headers/gen -Iout/soong/.intermediates/system/libhidl/transport/base/1.0/android.hidl.base@1.0_genc++_headers/gen -Isystem/libhwbinder/include -Isystem/core/base/include -Isystem/libhidl/base/include -Isystem/core/base/include -Isystem/libhidl/transport/include -Isystem/core/base/include -Isystem/libhidl/base/include -Isystem/core/base/include -Iout/soong/.intermediates/system/libhidl/transport/manager/1.0/android.hidl.manager@1.0_genc++_headers/gen -Iout/soong/.intermediates/system/libhidl/transport/base/1.0/android.hidl.base@1.0_genc++_headers/gen -Isystem/libhwbinder/include -Isystem/core/base/include -Isystem/libhidl/base/include -Isystem/core/base/include -Isystem/libhidl/transport/include -Isystem/core/base/include -Isystem/libhidl/base/include -Isystem/core/base/include -Iout/soong/.intermediates/system/libhidl/transport/manager/1.0/android.hidl.manager@1.0_genc++_headers/gen -Iout/soong/.intermediates/system/libhidl/transport/base/1.0/android.hidl.base@1.0_genc++_headers/gen -Isystem/libhwbinder/include -Isystem/core/base/include -Iout/soong/.intermediates/hardware/interfaces/graphics/common/1.0/android.hardware.graphics.common@1.0_genc++_headers/gen -Isystem/libhidl/base/include -Isystem/core/base/include -Isystem/libhidl/transport/include -Isystem/core/base/include -Isystem/libhidl/base/include -Isystem/core/base/include -Iout/soong/.intermediates/system/libhidl/transport/manager/1.0/android.hidl.manager@1.0_genc++_headers/gen -Iout/soong/.intermediates/system/libhidl/transport/base/1.0/android.hidl.base@1.0_genc++_headers/gen -Isystem/libhwbinder/include -Isystem/core/base/include -Iout/soong/.intermediates/system/libhidl/transport/base/1.0/android.hidl.base@1.0_genc++_headers/gen -Iout/soong/.intermediates/hardware/interfaces/graphics/allocator/2.0/android.hardware.graphics.allocator@2.0_genc++_headers/gen -Isystem/libhidl/base/include -Isystem/core/base/include -Isystem/libhidl/transport/include -Isystem/core/base/include -Isystem/libhidl/base/include -Isystem/core/base/include -Iout/soong/.intermediates/system/libhidl/transport/manager/1.0/android.hidl.manager@1.0_genc++_headers/gen -Iout/soong/.intermediates/system/libhidl/transport/base/1.0/android.hidl.base@1.0_genc++_headers/gen -Isystem/libhwbinder/include -Isystem/core/base/include -Iout/soong/.intermediates/hardware/interfaces/graphics/common/1.0/android.hardware.graphics.common@1.0_genc++_headers/gen -Isystem/libhidl/base/include -Isystem/core/base/include -Isystem/libhidl/transport/include -Isystem/core/base/include -Isystem/libhidl/base/include -Isystem/core/base/include -Iout/soong/.intermediates/system/libhidl/transport/manager/1.0/android.hidl.manager@1.0_genc++_headers/gen -Iout/soong/.intermediates/system/libhidl/transport/base/1.0/android.hidl.base@1.0_genc++_headers/gen -Isystem/libhwbinder/include -Isystem/core/base/include -Iout/soong/.intermediates/system/libhidl/transport/base/1.0/android.hidl.base@1.0_genc++_headers/gen -Iout/soong/.intermediates/hardware/interfaces/graphics/mapper/2.0/android.hardware.graphics.mapper@2.0_genc++_headers/gen -Isystem/core/base/include -Isystem/libhidl/base/include -Isystem/core/base/include -Isystem/libhidl/transport/include -Isystem/core/base/include -Isystem/libhidl/base/include -Isystem/core/base/include -Iout/soong/.intermediates/system/libhidl/transport/manager/1.0/android.hidl.manager@1.0_genc++_headers/gen -Iout/soong/.intermediates/system/libhidl/transport/base/1.0/android.hidl.base@1.0_genc++_headers/gen -Isystem/core/libsync/include -Iexternal/libcxx/include -Iexternal/libcxxabi/include' 61# variable ${config.CommonGlobalIncludes} = '-Isystem/core/include -Isystem/media/audio/include -Ihardware/libhardware/include -Ihardware/libhardware_legacy/include -Ihardware/ril/include -Ilibnativehelper/include -Iframeworks/native/include -Iframeworks/native/opengl/include' 62# parameters: '-Isystem/core/include -Isystem/media/audio/include -Ihardware/libhardware/include -Ihardware/libhardware_legacy/include -Ihardware/ril/include -Ilibnativehelper/include -Iframeworks/native/include -Iframeworks/native/opengl/include' 63# variable ${config.CommonGlobalSystemIncludes} = '-isystem frameworks/av/include' 64# parameters: '-isystem frameworks/av/include' 65# variable ${config.Arm64IncludeFlags} = '-isystem bionic/libc/arch-arm64/include -isystem bionic/libc/include -isystem bionic/libc/kernel/uapi -isystem bionic/libc/kernel/uapi/asm-arm64 -isystem bionic/libc/kernel/android/uapi' 66# parameters: '-isystem bionic/libc/arch-arm64/include -isystem bionic/libc/include -isystem bionic/libc/kernel/uapi -isystem bionic/libc/kernel/uapi/asm-arm64 -isystem bionic/libc/kernel/android/uapi' 67# variable ${config.CommonNativehelperInclude} = '-Ilibnativehelper/include/nativehelper' 68# parameters: '-Ilibnativehelper/include/nativehelper' 69# variable ${config.Arm64ClangCflags} = '-fno-exceptions -Wno-multichar -fno-strict-aliasing -fstack-protector-strong -ffunction-sections -fdata-sections -funwind-tables -Wa,--noexecstack -Werror=format-security -D_FORTIFY_SOURCE=2 -fno-short-enums -no-canonical-prefixes -Werror=pointer-to-int-cast -Werror=int-to-pointer-cast -Werror=implicit-function-declaration -DNDEBUG -O2 -g -Wstrict-aliasing=2' 70# parameters: '-fno-exceptions -Wno-multichar -fno-strict-aliasing -fstack-protector-strong -ffunction-sections -fdata-sections -funwind-tables -Wa,--noexecstack -Werror=format-security -D_FORTIFY_SOURCE=2 -fno-short-enums -no-canonical-prefixes -Werror=pointer-to-int-cast -Werror=int-to-pointer-cast -Werror=implicit-function-declaration -DNDEBUG -O2 -g -Wstrict-aliasing=2' 71# variable ${config.CommonClangGlobalCflags} = '-DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -DNDEBUG -UDEBUG -fdebug-prefix-map=/proc/self/cwd= -D__compiler_offsetof=__builtin_offsetof -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument -fcolor-diagnostics -Wno-expansion-to-defined' 72# parameters: '-DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -DNDEBUG -UDEBUG -fdebug-prefix-map=/proc/self/cwd= -D__compiler_offsetof=__builtin_offsetof -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument -fcolor-diagnostics -Wno-expansion-to-defined' 73# variable ${config.DeviceClangGlobalCflags} = '-Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Werror=date-time -nostdlibinc' 74# parameters: '-Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Werror=date-time -nostdlibinc' 75# variable ${config.Arm64ClangCortexA53Cflags} = '-mcpu=cortex-a53' 76# parameters: '-mcpu=cortex-a53' 77include_directories(SYSTEM "${ANDROID_ROOT}/bionic/libc/arch-arm64/include") 78include_directories(SYSTEM "${ANDROID_ROOT}/frameworks/av/include") 79include_directories(SYSTEM "${ANDROID_ROOT}/bionic/libc/include") 80include_directories(SYSTEM "${ANDROID_ROOT}/bionic/libc/kernel/uapi") 81include_directories(SYSTEM "${ANDROID_ROOT}/bionic/libc/kernel/uapi/asm-arm64") 82include_directories(SYSTEM "${ANDROID_ROOT}/bionic/libc/kernel/android/uapi") 83include_directories("${ANDROID_ROOT}/libnativehelper/include/nativehelper") 84include_directories("${ANDROID_ROOT}/system/libhidl/base/include") 85include_directories("${ANDROID_ROOT}/out/soong/.intermediates/system/libhidl/transport/base/1.0/android.hidl.base@1.0_genc++_headers/gen") 86include_directories("${ANDROID_ROOT}/system/libhwbinder/include") 87include_directories("${ANDROID_ROOT}/external/libcxx/include") 88include_directories("${ANDROID_ROOT}/external/libcxxabi/include") 89include_directories("${ANDROID_ROOT}/hardware/libhardware/include") 90include_directories("${ANDROID_ROOT}/hardware/libhardware_legacy/include") 91include_directories("${ANDROID_ROOT}/frameworks/native/include") 92include_directories("${ANDROID_ROOT}/system/core/base/include") 93include_directories("${ANDROID_ROOT}/out/soong/.intermediates/system/libhidl/transport/manager/1.0/android.hidl.manager@1.0_genc++_headers/gen") 94include_directories("${ANDROID_ROOT}/out/soong/.intermediates/hardware/interfaces/graphics/mapper/2.0/android.hardware.graphics.mapper@2.0_genc++_headers/gen") 95include_directories("${ANDROID_ROOT}/system/core/include") 96include_directories("${ANDROID_ROOT}/frameworks/native/libs/ui") 97include_directories("${ANDROID_ROOT}/out/soong/.intermediates/hardware/interfaces/graphics/common/1.0/android.hardware.graphics.common@1.0_genc++_headers/gen") 98include_directories("${ANDROID_ROOT}/system/core/libsync/include") 99include_directories("${ANDROID_ROOT}/libnativehelper/include") 100include_directories("${ANDROID_ROOT}/system/media/audio/include") 101include_directories("${ANDROID_ROOT}/hardware/ril/include") 102include_directories("${ANDROID_ROOT}/system/libhidl/transport/include") 103include_directories("${ANDROID_ROOT}/out/soong/.intermediates/hardware/interfaces/graphics/allocator/2.0/android.hardware.graphics.allocator@2.0_genc++_headers/gen") 104include_directories("${ANDROID_ROOT}/frameworks/native/opengl/include") 105include_directories("${ANDROID_ROOT}/hardware/interfaces/graphics/composer/2.1/default") 106include_directories("${ANDROID_ROOT}/out/soong/.intermediates/hardware/interfaces/graphics/composer/2.1/android.hardware.graphics.composer@2.1_genc++_headers/gen") 107include_directories("${ANDROID_ROOT}/frameworks/native/services/surfaceflinger") 108include_directories("${ANDROID_ROOT}/system/libfmq/include") 109 110set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-exceptions") 111set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-multichar") 112set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-strict-aliasing") 113set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector-strong") 114set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffunction-sections") 115set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdata-sections") 116set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -funwind-tables") 117set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wa,--noexecstack") 118set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=format-security") 119set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_FORTIFY_SOURCE=2") 120set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-short-enums") 121set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -no-canonical-prefixes") 122set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=pointer-to-int-cast") 123set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=int-to-pointer-cast") 124set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=implicit-function-declaration") 125set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNDEBUG") 126set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2") 127set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g") 128set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wstrict-aliasing=2") 129set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DANDROID") 130set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmessage-length=0") 131set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -W") 132set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") 133set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused") 134set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Winit-self") 135set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wpointer-arith") 136set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNDEBUG") 137set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -UDEBUG") 138set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdebug-prefix-map=/proc/self/cwd=") 139set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__compiler_offsetof=__builtin_offsetof") 140set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=int-conversion") 141set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-reserved-id-macro") 142set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-format-pedantic") 143set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-command-line-argument") 144set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fcolor-diagnostics") 145set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-expansion-to-defined") 146set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=return-type") 147set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=non-virtual-dtor") 148set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=address") 149set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=sequence-point") 150set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=date-time") 151set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -nostdlibinc") 152set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions") 153set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-multichar") 154set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing") 155set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector-strong") 156set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffunction-sections") 157set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdata-sections") 158set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -funwind-tables") 159set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wa,--noexecstack") 160set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=format-security") 161set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FORTIFY_SOURCE=2") 162set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-short-enums") 163set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -no-canonical-prefixes") 164set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=pointer-to-int-cast") 165set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=int-to-pointer-cast") 166set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=implicit-function-declaration") 167set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNDEBUG") 168set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2") 169set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g") 170set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wstrict-aliasing=2") 171set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DANDROID") 172set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0") 173set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W") 174set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") 175set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused") 176set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Winit-self") 177set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wpointer-arith") 178set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNDEBUG") 179set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -UDEBUG") 180set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdebug-prefix-map=/proc/self/cwd=") 181set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__compiler_offsetof=__builtin_offsetof") 182set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=int-conversion") 183set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-reserved-id-macro") 184set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-format-pedantic") 185set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-command-line-argument") 186set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcolor-diagnostics") 187set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-expansion-to-defined") 188set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=return-type") 189set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=non-virtual-dtor") 190set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=address") 191set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=sequence-point") 192set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=date-time") 193set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -nostdlibinc") 194 195# CFLAGS: 196# parameters: '-target aarch64-linux-android -B${config.Arm64GccRoot}/aarch64-linux-android/bin -DANDROID_STRICT -fPIC -D_USING_LIBCXX' 197set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -target") 198set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} aarch64-linux-android") 199set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -B${config.Arm64GccRoot}/aarch64-linux-android/bin") 200set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DANDROID_STRICT") 201set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") 202set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_USING_LIBCXX") 203set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -target") 204set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} aarch64-linux-android") 205set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -B${config.Arm64GccRoot}/aarch64-linux-android/bin") 206set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DANDROID_STRICT") 207set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") 208set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_USING_LIBCXX") 209 210# C ONLY FLAGS: 211# parameters: '-std=gnu99 ${config.CommonGlobalConlyflags}' 212# variable ${config.CommonGlobalConlyflags} = '' 213# parameters: '' 214set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") 215 216# CPP FLAGS: 217# parameters: '-std=gnu++14 ${config.CommonClangGlobalCppflags} -Weverything -Werror -Wno-exit-time-destructors -Wno-global-constructors -Wno-c++98-compat-pedantic -Wno-float-equal -Wno-four-char-constants -Wno-padded -fno-rtti ${config.Arm64ClangCppflags}' 218# variable ${config.CommonClangGlobalCppflags} = '-Wsign-promo -Wno-inconsistent-missing-override -Wno-null-dereference' 219# parameters: '-Wsign-promo -Wno-inconsistent-missing-override -Wno-null-dereference' 220# variable ${config.Arm64ClangCppflags} = '-fvisibility-inlines-hidden' 221# parameters: '-fvisibility-inlines-hidden' 222set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++14") 223set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsign-promo") 224set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-inconsistent-missing-override") 225set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-null-dereference") 226set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Weverything") 227set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") 228set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-exit-time-destructors") 229set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-global-constructors") 230set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c++98-compat-pedantic") 231set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-float-equal") 232set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-four-char-constants") 233set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-padded") 234set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti") 235set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden") 236 237add_executable(surfaceflinger ${SOURCE_FILES}) 238