Commit 9ec919a6 by Greg Hartman

Revise the SwiftShader makefiles to avoid compile errors

We can get intermittent compile errors with the current makefiles because the same .cpp is built from multiple Android.mk's. The normal way to resolve this is to use static libraries to hold the common files. Change-Id: Ifd39809dfac8c96a622b98ef83f31510b34461e4 Reviewed-on: https://swiftshader-review.googlesource.com/2890Reviewed-by: 's avatarNicolas Capens <capn@google.com> Tested-by: 's avatarGreg Hartman <ghartman@google.com>
parent 11171158
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_CLANG := true
LOCAL_MODULE := swiftshader_top
LOCAL_SRC_FILES := \
Common/CPUID.cpp \
Common/Configurator.cpp \
Common/DebugAndroid.cpp \
Common/Half.cpp \
Common/Math.cpp \
Common/Memory.cpp \
Common/Resource.cpp \
Common/Socket.cpp \
Common/Thread.cpp \
Common/Timer.cpp
LOCAL_SRC_FILES += \
Main/Config.cpp \
Main/FrameBuffer.cpp \
Main/FrameBufferAndroid.cpp \
Main/Logo.cpp \
Main/Register.cpp \
Main/SwiftConfig.cpp \
Main/crc.cpp \
Main/serialvalid.cpp \
LOCAL_SRC_FILES += \
Reactor/Nucleus.cpp \
Reactor/Routine.cpp \
Reactor/RoutineManager.cpp
LOCAL_SRC_FILES += \
Renderer/Blitter.cpp \
Renderer/Clipper.cpp \
Renderer/Color.cpp \
Renderer/Context.cpp \
Renderer/Matrix.cpp \
Renderer/PixelProcessor.cpp \
Renderer/Plane.cpp \
Renderer/Point.cpp \
Renderer/QuadRasterizer.cpp \
Renderer/Rasterizer.cpp \
Renderer/Renderer.cpp \
Renderer/Sampler.cpp \
Renderer/SetupProcessor.cpp \
Renderer/Surface.cpp \
Renderer/TextureStage.cpp \
Renderer/Vector.cpp \
Renderer/VertexProcessor.cpp \
LOCAL_SRC_FILES += \
Shader/Constants.cpp \
Shader/PixelRoutine.cpp \
Shader/PixelShader.cpp \
Shader/SamplerCore.cpp \
Shader/SetupRoutine.cpp \
Shader/Shader.cpp \
Shader/ShaderCore.cpp \
Shader/VertexPipeline.cpp \
Shader/VertexProgram.cpp \
Shader/VertexRoutine.cpp \
Shader/VertexShader.cpp \
LOCAL_SRC_FILES += \
OpenGL/common/NameSpace.cpp \
OpenGL/common/Object.cpp \
OpenGL/common/MatrixStack.cpp \
LOCAL_CFLAGS += -DLOG_TAG=\"swiftshader\"
LOCAL_CFLAGS += -fno-operator-names -msse2 -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS
LOCAL_CFLAGS += -std=c++11
# Android's make system also uses NDEBUG, so we need to set/unset it forcefully
# Uncomment for ON:
LOCAL_CFLAGS += -UNDEBUG -g -O0
# Uncomment for OFF:
#LOCAL_CFLAGS += -fomit-frame-pointer -ffunction-sections -fdata-sections -DANGLE_DISABLE_TRACE
LOCAL_C_INCLUDES += \
$(LOCAL_PATH)/OpenGL/include \
$(LOCAL_PATH)/OpenGL/ \
$(LOCAL_PATH) \
$(LOCAL_PATH)/Renderer/ \
$(LOCAL_PATH)/Common/ \
$(LOCAL_PATH)/Shader/ \
$(LOCAL_PATH)/LLVM/include \
$(LOCAL_PATH)/Main/
include external/stlport/libstlport.mk
include $(BUILD_STATIC_LIBRARY)
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_CLANG := true
LOCAL_MODULE := swiftshader_compiler
LOCAL_SRC_FILES += \
preprocessor/Diagnostics.cpp \
preprocessor/DirectiveHandler.cpp \
preprocessor/DirectiveParser.cpp \
preprocessor/ExpressionParser.cpp \
preprocessor/Input.cpp \
preprocessor/Lexer.cpp \
preprocessor/Macro.cpp \
preprocessor/MacroExpander.cpp \
preprocessor/Preprocessor.cpp \
preprocessor/Token.cpp \
preprocessor/Tokenizer.cpp \
AnalyzeCallDepth.cpp \
Compiler.cpp \
debug.cpp \
Diagnostics.cpp \
DirectiveHandler.cpp \
glslang_lex.cpp \
glslang_tab.cpp \
InfoSink.cpp \
Initialize.cpp \
InitializeParseContext.cpp \
IntermTraverse.cpp \
Intermediate.cpp \
intermOut.cpp \
ossource_posix.cpp \
OutputASM.cpp \
parseConst.cpp \
ParseHelper.cpp \
PoolAlloc.cpp \
SymbolTable.cpp \
TranslatorASM.cpp \
util.cpp \
ValidateLimitations.cpp \
LOCAL_CFLAGS += -DLOG_TAG=\"swiftshader_compiler\"
# Android's make system also uses NDEBUG, so we need to set/unset it forcefully
# Uncomment for ON:
LOCAL_CFLAGS += -UNDEBUG -g -O0
# Uncomment for OFF:
#LOCAL_CFLAGS += -fomit-frame-pointer -ffunction-sections -fdata-sections -DANGLE_DISABLE_TRACE
LOCAL_CFLAGS += -fno-operator-names -msse2 -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS
LOCAL_CFLAGS += -std=c++11
LOCAL_C_INCLUDES += \
$(LOCAL_PATH)/../include \
$(LOCAL_PATH)/../ \
$(LOCAL_PATH)/../../ \
$(LOCAL_PATH)/../../LLVM/include-android \
$(LOCAL_PATH)/../../LLVM/include-linux \
$(LOCAL_PATH)/../../LLVM/include \
$(LOCAL_PATH)/../../LLVM/lib/Target/X86 \
$(LOCAL_PATH)/../../Renderer/ \
$(LOCAL_PATH)/../../Common/ \
$(LOCAL_PATH)/../../Shader/ \
$(LOCAL_PATH)/../../Main/
include external/stlport/libstlport.mk
include $(BUILD_STATIC_LIBRARY)
...@@ -7,8 +7,6 @@ LOCAL_MODULE_PATH := $(TARGET_OUT)/vendor/lib/egl ...@@ -7,8 +7,6 @@ LOCAL_MODULE_PATH := $(TARGET_OUT)/vendor/lib/egl
LOCAL_MODULE := libEGL_swiftshader LOCAL_MODULE := libEGL_swiftshader
LOCAL_SRC_FILES += \ LOCAL_SRC_FILES += \
../common/Object.cpp \
../../Common/DebugAndroid.cpp \
Config.cpp \ Config.cpp \
Display.cpp \ Display.cpp \
Surface.cpp \ Surface.cpp \
...@@ -27,7 +25,7 @@ LOCAL_CFLAGS += -std=c++11 ...@@ -27,7 +25,7 @@ LOCAL_CFLAGS += -std=c++11
# These changes tie the build to Cloud Android. Do something else # These changes tie the build to Cloud Android. Do something else
# for other Android builds. # for other Android builds.
LOCAL_STATIC_LIBRARIES += libgceframebufferconfig libgcemetadata LOCAL_STATIC_LIBRARIES += swiftshader_top libgceframebufferconfig libgcemetadata
LOCAL_C_INCLUDES += device/google/gce/include LOCAL_C_INCLUDES += device/google/gce/include
LOCAL_SHARED_LIBRARIES += libdl liblog libandroid libutils libcutils $(GCE_STLPORT_LIBS) LOCAL_SHARED_LIBRARIES += libdl liblog libandroid libutils libcutils $(GCE_STLPORT_LIBS)
......
...@@ -6,70 +6,6 @@ LOCAL_CLANG := true ...@@ -6,70 +6,6 @@ LOCAL_CLANG := true
LOCAL_MODULE_PATH := $(TARGET_OUT)/vendor/lib/egl LOCAL_MODULE_PATH := $(TARGET_OUT)/vendor/lib/egl
LOCAL_MODULE := libGLESv1_CM_swiftshader LOCAL_MODULE := libGLESv1_CM_swiftshader
LOCAL_SRC_FILES := \
../../Common/CPUID.cpp \
../../Common/Configurator.cpp \
../../Common/DebugAndroid.cpp \
../../Common/Half.cpp \
../../Common/Math.cpp \
../../Common/Memory.cpp \
../../Common/Resource.cpp \
../../Common/Socket.cpp \
../../Common/Thread.cpp \
../../Common/Timer.cpp
LOCAL_SRC_FILES += \
../../Main/Config.cpp \
../../Main/FrameBuffer.cpp \
../../Main/FrameBufferAndroid.cpp \
../../Main/Logo.cpp \
../../Main/Register.cpp \
../../Main/SwiftConfig.cpp \
../../Main/crc.cpp \
../../Main/serialvalid.cpp \
LOCAL_SRC_FILES += \
../../Reactor/Nucleus.cpp \
../../Reactor/Routine.cpp \
../../Reactor/RoutineManager.cpp
LOCAL_SRC_FILES += \
../../Renderer/Blitter.cpp \
../../Renderer/Clipper.cpp \
../../Renderer/Color.cpp \
../../Renderer/Context.cpp \
../../Renderer/Matrix.cpp \
../../Renderer/PixelProcessor.cpp \
../../Renderer/Plane.cpp \
../../Renderer/Point.cpp \
../../Renderer/QuadRasterizer.cpp \
../../Renderer/Rasterizer.cpp \
../../Renderer/Renderer.cpp \
../../Renderer/Sampler.cpp \
../../Renderer/SetupProcessor.cpp \
../../Renderer/Surface.cpp \
../../Renderer/TextureStage.cpp \
../../Renderer/Vector.cpp \
../../Renderer/VertexProcessor.cpp \
LOCAL_SRC_FILES += \
../../Shader/Constants.cpp \
../../Shader/PixelRoutine.cpp \
../../Shader/PixelShader.cpp \
../../Shader/SamplerCore.cpp \
../../Shader/SetupRoutine.cpp \
../../Shader/Shader.cpp \
../../Shader/ShaderCore.cpp \
../../Shader/VertexPipeline.cpp \
../../Shader/VertexProgram.cpp \
../../Shader/VertexRoutine.cpp \
../../Shader/VertexShader.cpp \
LOCAL_SRC_FILES += \
../common/NameSpace.cpp \
../common/Object.cpp \
../common/MatrixStack.cpp \
LOCAL_SRC_FILES += \ LOCAL_SRC_FILES += \
Buffer.cpp \ Buffer.cpp \
Context.cpp \ Context.cpp \
...@@ -98,7 +34,7 @@ LOCAL_CFLAGS += -UNDEBUG -g -O0 ...@@ -98,7 +34,7 @@ LOCAL_CFLAGS += -UNDEBUG -g -O0
LOCAL_SHARED_LIBRARIES += libdl liblog libcutils libhardware libui libutils \ LOCAL_SHARED_LIBRARIES += libdl liblog libcutils libhardware libui libutils \
$(GCE_STLPORT_LIBS) $(GCE_STLPORT_LIBS)
LOCAL_STATIC_LIBRARIES += libLLVM_swiftshader LOCAL_STATIC_LIBRARIES += swiftshader_top libLLVM_swiftshader
LOCAL_LDFLAGS += -Wl,--gc-sections -Wl,--version-script=$(LOCAL_PATH)/exports.map -Wl,--hash-style=sysv LOCAL_LDFLAGS += -Wl,--gc-sections -Wl,--version-script=$(LOCAL_PATH)/exports.map -Wl,--hash-style=sysv
LOCAL_C_INCLUDES += \ LOCAL_C_INCLUDES += \
......
...@@ -6,104 +6,6 @@ LOCAL_CLANG := true ...@@ -6,104 +6,6 @@ LOCAL_CLANG := true
LOCAL_MODULE_PATH := $(TARGET_OUT)/vendor/lib/egl LOCAL_MODULE_PATH := $(TARGET_OUT)/vendor/lib/egl
LOCAL_MODULE := libGLESv2_swiftshader LOCAL_MODULE := libGLESv2_swiftshader
LOCAL_SRC_FILES := \
../../Common/CPUID.cpp \
../../Common/Configurator.cpp \
../../Common/DebugAndroid.cpp \
../../Common/Half.cpp \
../../Common/Math.cpp \
../../Common/Memory.cpp \
../../Common/Resource.cpp \
../../Common/Socket.cpp \
../../Common/Thread.cpp \
../../Common/Timer.cpp
LOCAL_SRC_FILES += \
../../Main/Config.cpp \
../../Main/FrameBuffer.cpp \
../../Main/FrameBufferAndroid.cpp \
../../Main/Logo.cpp \
../../Main/Register.cpp \
../../Main/SwiftConfig.cpp \
../../Main/crc.cpp \
../../Main/serialvalid.cpp \
LOCAL_SRC_FILES += \
../../Reactor/Nucleus.cpp \
../../Reactor/Routine.cpp \
../../Reactor/RoutineManager.cpp
LOCAL_SRC_FILES += \
../../Renderer/Blitter.cpp \
../../Renderer/Clipper.cpp \
../../Renderer/Color.cpp \
../../Renderer/Context.cpp \
../../Renderer/Matrix.cpp \
../../Renderer/PixelProcessor.cpp \
../../Renderer/Plane.cpp \
../../Renderer/Point.cpp \
../../Renderer/QuadRasterizer.cpp \
../../Renderer/Rasterizer.cpp \
../../Renderer/Renderer.cpp \
../../Renderer/Sampler.cpp \
../../Renderer/SetupProcessor.cpp \
../../Renderer/Surface.cpp \
../../Renderer/TextureStage.cpp \
../../Renderer/Vector.cpp \
../../Renderer/VertexProcessor.cpp \
LOCAL_SRC_FILES += \
../../Shader/Constants.cpp \
../../Shader/PixelRoutine.cpp \
../../Shader/PixelShader.cpp \
../../Shader/SamplerCore.cpp \
../../Shader/SetupRoutine.cpp \
../../Shader/Shader.cpp \
../../Shader/ShaderCore.cpp \
../../Shader/VertexPipeline.cpp \
../../Shader/VertexProgram.cpp \
../../Shader/VertexRoutine.cpp \
../../Shader/VertexShader.cpp \
LOCAL_SRC_FILES += \
../common/NameSpace.cpp \
../common/Object.cpp \
LOCAL_SRC_FILES += \
../compiler/preprocessor/Diagnostics.cpp \
../compiler/preprocessor/DirectiveHandler.cpp \
../compiler/preprocessor/DirectiveParser.cpp \
../compiler/preprocessor/ExpressionParser.cpp \
../compiler/preprocessor/Input.cpp \
../compiler/preprocessor/Lexer.cpp \
../compiler/preprocessor/Macro.cpp \
../compiler/preprocessor/MacroExpander.cpp \
../compiler/preprocessor/Preprocessor.cpp \
../compiler/preprocessor/Token.cpp \
../compiler/preprocessor/Tokenizer.cpp \
../compiler/AnalyzeCallDepth.cpp \
../compiler/Compiler.cpp \
../compiler/debug.cpp \
../compiler/Diagnostics.cpp \
../compiler/DirectiveHandler.cpp \
../compiler/glslang_lex.cpp \
../compiler/glslang_tab.cpp \
../compiler/InfoSink.cpp \
../compiler/Initialize.cpp \
../compiler/InitializeParseContext.cpp \
../compiler/IntermTraverse.cpp \
../compiler/Intermediate.cpp \
../compiler/intermOut.cpp \
../compiler/ossource_posix.cpp \
../compiler/OutputASM.cpp \
../compiler/parseConst.cpp \
../compiler/ParseHelper.cpp \
../compiler/PoolAlloc.cpp \
../compiler/SymbolTable.cpp \
../compiler/TranslatorASM.cpp \
../compiler/util.cpp \
../compiler/ValidateLimitations.cpp \
LOCAL_SRC_FILES += \ LOCAL_SRC_FILES += \
Buffer.cpp \ Buffer.cpp \
Context.cpp \ Context.cpp \
...@@ -138,7 +40,7 @@ LOCAL_CFLAGS += -std=c++11 ...@@ -138,7 +40,7 @@ LOCAL_CFLAGS += -std=c++11
LOCAL_SHARED_LIBRARIES += libdl liblog libcutils libhardware libui libutils \ LOCAL_SHARED_LIBRARIES += libdl liblog libcutils libhardware libui libutils \
$(GCE_STLPORT_LIBS) $(GCE_STLPORT_LIBS)
LOCAL_STATIC_LIBRARIES += libLLVM_swiftshader LOCAL_STATIC_LIBRARIES += swiftshader_compiler swiftshader_top libLLVM_swiftshader
LOCAL_LDFLAGS += -Wl,--gc-sections -Wl,--version-script=$(LOCAL_PATH)/exports.map -Wl,--hash-style=sysv LOCAL_LDFLAGS += -Wl,--gc-sections -Wl,--version-script=$(LOCAL_PATH)/exports.map -Wl,--hash-style=sysv
LOCAL_C_INCLUDES += \ LOCAL_C_INCLUDES += \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment