aboutsummaryrefslogtreecommitdiff
path: root/third_party
diff options
context:
space:
mode:
authordan sinclair <dj2@everburning.com>2019-02-20 15:47:49 -0500
committerGitHub <noreply@github.com>2019-02-20 15:47:49 -0500
commitec5f9d42e67216cd1a2030a4f9dc392a6808ddf7 (patch)
tree1aff02df96886b25a7c8b436f99457f25ec428e6 /third_party
parentff296ea40354da2f891b27dbd52a3d1685e31d8b (diff)
downloadamber-ec5f9d42e67216cd1a2030a4f9dc392a6808ddf7.tar.gz
Add image dump in PNG (#302)
This change adds support to dump image to PNG format, it relies on the third party 'lodepng' library (zlib license). This CL is based on Pull #301 by @hevrard.
Diffstat (limited to 'third_party')
-rw-r--r--third_party/Android.mk9
-rw-r--r--third_party/CMakeLists.txt389
2 files changed, 218 insertions, 180 deletions
diff --git a/third_party/Android.mk b/third_party/Android.mk
index c490378..ac00d05 100644
--- a/third_party/Android.mk
+++ b/third_party/Android.mk
@@ -1,5 +1,14 @@
THIRD_PARTY_PATH := $(call my-dir)
+LOCAL_PATH := $(call my-dir)
+
+# Lodepng
+include $(CLEAR_VARS)
+LOCAL_MODULE:=lodepng
+LOCAL_CXXFLAGS:=-std=c++11 -fno-exceptions -fno-rtti
+LOCAL_SRC_FILES:= lodepng/lodepng.cpp
+include $(BUILD_STATIC_LIBRARY)
+
ifeq ($(GLSLANG_LOCAL_PATH),)
GLSLANG_LOCAL_PATH:=$(THIRD_PARTY_PATH)/glslang
endif
diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt
index 12dbffb..6e29dde 100644
--- a/third_party/CMakeLists.txt
+++ b/third_party/CMakeLists.txt
@@ -15,118 +15,132 @@
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# Turn off warnings to make gtest happy
set(GTEST_BUILD_FIXES
- -Wno-covered-switch-default
- -Wno-deprecated
- -Wno-disabled-macro-expansion
- -Wno-exit-time-constructors
- -Wno-exit-time-destructors
- -Wno-extra-semi-stmt
- -Wno-global-constructors
- -Wno-missing-field-initializers
- -Wno-format-nonliteral
- -Wno-missing-noreturn
- -Wno-missing-prototypes
- -Wno-missing-variable-declarations
- -Wno-shift-sign-overflow
- -Wno-sign-conversion
- -Wno-undef
- -Wno-unused-member-function
- -Wno-used-but-marked-unused
- -Wno-weak-vtables
- -Wno-zero-as-null-pointer-constant)
+ -Wno-covered-switch-default
+ -Wno-deprecated
+ -Wno-disabled-macro-expansion
+ -Wno-exit-time-constructors
+ -Wno-exit-time-destructors
+ -Wno-extra-semi-stmt
+ -Wno-global-constructors
+ -Wno-missing-field-initializers
+ -Wno-format-nonliteral
+ -Wno-missing-noreturn
+ -Wno-missing-prototypes
+ -Wno-missing-variable-declarations
+ -Wno-shift-sign-overflow
+ -Wno-sign-conversion
+ -Wno-undef
+ -Wno-unused-member-function
+ -Wno-used-but-marked-unused
+ -Wno-weak-vtables
+ -Wno-zero-as-null-pointer-constant)
set(GLSLANG_BUILD_FIXES
- -Wno-conversion
- -Wno-covered-switch-default
- -Wno-date-time
- -Wno-deprecated
- -Wno-disabled-macro-expansion
- -Wno-double-promotion
- -Wno-error
- -Wno-exit-time-destructors
- -Wno-extra-semi
- -Wno-extra-semi-stmt
- -Wno-float-equal
- -Wno-format-nonliteral
- -Wno-format-pedantic
- -Wno-global-constructors
- -Wno-gnu-redeclared-enum
- -Wno-implicit-fallthrough
- -Wno-inconsistent-missing-destructor-override
- -Wno-missing-field-initializers
- -Wno-missing-noreturn
- -Wno-missing-prototypes
- -Wno-missing-variable-declarations
- -Wno-newline-eof
- -Wno-old-style-cast
- -Wno-reserved-id-macro
- -Wno-shadow
- -Wno-shadow-field
- -Wno-shadow-field-in-constructor
- -Wno-shift-sign-overflow
- -Wno-sign-conversion
- -Wno-signed-enum-bitfield
- -Wno-undef
- -Wno-undefined-func-template
- -Wno-undefined-reinterpret-cast
- -Wno-unreachable-code
- -Wno-unreachable-code-break
- -Wno-unreachable-code-return
- -Wno-unused-macros
- -Wno-unused-parameter
- -Wno-unused-variable
- -Wno-used-but-marked-unused
- -Wno-weak-vtables
- -Wno-zero-as-null-pointer-constant)
+ -Wno-conversion
+ -Wno-covered-switch-default
+ -Wno-date-time
+ -Wno-deprecated
+ -Wno-disabled-macro-expansion
+ -Wno-double-promotion
+ -Wno-error
+ -Wno-exit-time-destructors
+ -Wno-extra-semi
+ -Wno-extra-semi-stmt
+ -Wno-float-equal
+ -Wno-format-nonliteral
+ -Wno-format-pedantic
+ -Wno-global-constructors
+ -Wno-gnu-redeclared-enum
+ -Wno-implicit-fallthrough
+ -Wno-inconsistent-missing-destructor-override
+ -Wno-missing-field-initializers
+ -Wno-missing-noreturn
+ -Wno-missing-prototypes
+ -Wno-missing-variable-declarations
+ -Wno-newline-eof
+ -Wno-old-style-cast
+ -Wno-reserved-id-macro
+ -Wno-shadow
+ -Wno-shadow-field
+ -Wno-shadow-field-in-constructor
+ -Wno-shift-sign-overflow
+ -Wno-sign-conversion
+ -Wno-signed-enum-bitfield
+ -Wno-undef
+ -Wno-undefined-func-template
+ -Wno-undefined-reinterpret-cast
+ -Wno-unreachable-code
+ -Wno-unreachable-code-break
+ -Wno-unreachable-code-return
+ -Wno-unused-macros
+ -Wno-unused-parameter
+ -Wno-unused-variable
+ -Wno-used-but-marked-unused
+ -Wno-weak-vtables
+ -Wno-zero-as-null-pointer-constant)
+
+ set(LODEPNG_BUILD_FIXES
+ -Wno-cast-qual
+ -Wno-conversion
+ -Wno-covered-switch-default
+ -Wno-deprecated
+ -Wno-extra-semi-stmt
+ -Wno-implicit-int-conversion
+ -Wno-missing-prototypes
+ -Wno-old-style-cast
+ -Wno-shorten-64-to-32
+ -Wno-weak-vtables
+ -Wno-zero-as-null-pointer-constant)
set(SPIRV_TOOLS_BUILD_FIXES
- -Wno-conditional-uninitialized
- -Wno-covered-switch-default
- -Wno-deprecated
- -Wno-documentation
- -Wno-documentation-pedantic
- -Wno-double-promotion
- -Wno-extra-semi
- -Wno-extra-semi-stmt
- -Wno-float-equal
- -Wno-format-nonliteral
- -Wno-implicit-fallthrough
- -Wno-missing-prototypes
- -Wno-old-style-cast
- -Wno-range-loop-analysis
- -Wno-shift-sign-overflow
- -Wno-unreachable-code-break
- -Wno-unreachable-code-return
- -Wno-unused-member-function
- -Wno-weak-vtables
- -Wno-zero-as-null-pointer-constant)
+ -Wno-conditional-uninitialized
+ -Wno-covered-switch-default
+ -Wno-deprecated
+ -Wno-documentation
+ -Wno-documentation-pedantic
+ -Wno-double-promotion
+ -Wno-extra-semi
+ -Wno-extra-semi-stmt
+ -Wno-float-equal
+ -Wno-format-nonliteral
+ -Wno-implicit-fallthrough
+ -Wno-missing-prototypes
+ -Wno-old-style-cast
+ -Wno-range-loop-analysis
+ -Wno-shift-sign-overflow
+ -Wno-unreachable-code-break
+ -Wno-unreachable-code-return
+ -Wno-unused-member-function
+ -Wno-weak-vtables
+ -Wno-zero-as-null-pointer-constant)
set(SHADERC_BUILD_FIXES
- -Wno-comma
- -Wno-conversion
- -Wno-covered-switch
- -Wno-covered-switch-default
- -Wno-deprecated
- -Wno-disabled-macro-expansion
- -Wno-double-promotion
- -Wno-extra-semi
- -Wno-float-equal
- -Wno-global-constructors
- -Wno-inconsistent-missing-destructor-override
- -Wno-missing-field-initializers
- -Wno-missing-prototypes
- -Wno-newline-eof
- -Wno-old-style-cast
- -Wno-reserved-id-macro
- -Wno-shadow
- -Wno-shadow-uncaptured-local
- -Wno-shadow-field-in-constructor
- -Wno-sign-conversion
- -Wno-signed-enum-bitfield
- -Wno-undef
- -Wno-unreachable-code-return
- -Wno-weak-vtables
- -Wno-zero-as-null-pointer-constant
+ -Wno-comma
+ -Wno-conversion
+ -Wno-covered-switch
+ -Wno-covered-switch-default
+ -Wno-deprecated
+ -Wno-disabled-macro-expansion
+ -Wno-double-promotion
+ -Wno-extra-semi
+ -Wno-float-equal
+ -Wno-global-constructors
+ -Wno-inconsistent-missing-destructor-override
+ -Wno-missing-field-initializers
+ -Wno-missing-prototypes
+ -Wno-newline-eof
+ -Wno-old-style-cast
+ -Wno-reserved-id-macro
+ -Wno-shadow
+ -Wno-shadow-field
+ -Wno-shadow-field-in-constructor
+ -Wno-shadow-uncaptured-local
+ -Wno-sign-conversion
+ -Wno-signed-enum-bitfield
+ -Wno-undef
+ -Wno-unreachable-code-return
+ -Wno-weak-vtables
+ -Wno-zero-as-null-pointer-constant
)
endif()
@@ -134,14 +148,16 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(GTEST_BUILD_FIXES "")
set(GLSLANG_BUILD_FIXES
- -Wno-error
- -Wno-implicit-fallthrough
- -Wno-overflow
- -Wno-missing-field-initializers
- -Wno-pedantic
- -Wno-strict-aliasing
- -Wno-unused-parameter
- -Wno-unused-variable)
+ -Wno-error
+ -Wno-implicit-fallthrough
+ -Wno-overflow
+ -Wno-missing-field-initializers
+ -Wno-pedantic
+ -Wno-strict-aliasing
+ -Wno-unused-parameter
+ -Wno-unused-variable)
+
+ set(LODEPNG_BUILD_FIXES "")
set(SPIRV_TOOLS_BUILD_FIXES "")
@@ -152,78 +168,78 @@ endif()
if (MSVC)
set(GTEST_BUILD_FIXES
- /W3
- /wd4061
- /wd4365
- /wd4514
- /wd4571
- /wd4623
- /wd4625
- /wd4626
- /wd4668
- /wd4710
- /wd4774
- /wd4820
- /wd5026
- /wd5027
- /wd5039
- /wd5045
- )
+ /W3
+ /wd4061
+ /wd4365
+ /wd4514
+ /wd4571
+ /wd4623
+ /wd4625
+ /wd4626
+ /wd4668
+ /wd4710
+ /wd4774
+ /wd4820
+ /wd5026
+ /wd5027
+ /wd5039
+ /wd5045)
set(GLSLANG_BUILD_FIXES
- /W3
- /wd4242
- /wd4244
- /wd4571
- /wd4623
- /wd4625
- /wd4626
- /wd4702
- /wd4774
- /wd4820
- /wd4946
- /wd4996
- /wd5026
- /wd5027
- /wd5045
- )
+ /W3
+ /wd4242
+ /wd4244
+ /wd4571
+ /wd4623
+ /wd4625
+ /wd4626
+ /wd4702
+ /wd4774
+ /wd4820
+ /wd4946
+ /wd4996
+ /wd5026
+ /wd5027
+ /wd5045)
+
+ set(LODEPNG_BUILD_FIXES
+ /W3
+ /wd4267)
set(SPIRV_TOOLS_BUILD_FIXES
/W3
- /wd4365
- /wd4389
- /wd4571
- /wd4623
- /wd4625
- /wd4626
- /wd4702
- /wd4706
- /wd4710
- /wd4774
- /wd4820
- /wd4826
- /wd4868
- /wd5026
- /wd5027
- /wd5045
- )
+ /wd4365
+ /wd4389
+ /wd4571
+ /wd4623
+ /wd4625
+ /wd4626
+ /wd4702
+ /wd4706
+ /wd4710
+ /wd4774
+ /wd4820
+ /wd4826
+ /wd4868
+ /wd5026
+ /wd5027
+ /wd5045)
-set(SHADERC_BUILD_FIXES
- /W3
- /wd4365
- /wd4571
- /wd4623
- /wd4625
- /wd4626
- /wd4702
- /wd4774
- /wd4820
- /wd4996
- /wd5026
- /wd5027
- /wd5039
- /wd5045
- )
+ set(SHADERC_BUILD_FIXES
+ /W3
+ /wd4365
+ /wd4571
+ /wd4623
+ /wd4625
+ /wd4626
+ /wd4702
+ /wd4774
+ /wd4820
+ /wd4996
+ /wd5026
+ /wd5027
+ /wd5039
+ /wd5045)
endif()
if (${AMBER_ENABLE_TESTS})
@@ -268,3 +284,16 @@ if (${AMBER_ENABLE_SHADERC})
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/shaderc)
set(CMAKE_CXX_FLAGS ${CXX_BACK})
endif()
+
+if (${AMBER_ENABLE_SAMPLES})
+ # Lodepng
+ set(LODEPNG_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/lodepng/lodepng.cpp)
+ STRING(REGEX REPLACE ";" " " LODEPNG_BUILD_FIXES "${LODEPNG_BUILD_FIXES}")
+
+ set_source_files_properties(
+ ${LODEPNG_SOURCES}
+ PROPERTIES
+ COMPILE_FLAGS "${LODEPNG_BUILD_FIXES}")
+
+ add_library(lodepng STATIC ${LODEPNG_SOURCES})
+endif()