Merge pull request #888 from raetiacorvus/fix-clang-build
Fix clang build errors
This commit is contained in:
commit
e6bd4370c3
6 changed files with 11 additions and 6 deletions
4
external/cpu_features/CMakeLists.txt
vendored
4
external/cpu_features/CMakeLists.txt
vendored
|
|
@ -5,6 +5,10 @@ project(CpuFeatures VERSION 0.1.0)
|
||||||
# ANBOX allow to build in our more strict build environment
|
# ANBOX allow to build in our more strict build environment
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error=switch-default -Wno-error=unused-parameter -Wno-error=overflow")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error=switch-default -Wno-error=unused-parameter -Wno-error=overflow")
|
||||||
|
|
||||||
|
if("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error=cast-align")
|
||||||
|
endif()
|
||||||
|
|
||||||
# Default Build Type to be Release
|
# Default Build Type to be Release
|
||||||
if(NOT CMAKE_BUILD_TYPE)
|
if(NOT CMAKE_BUILD_TYPE)
|
||||||
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
|
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ anbox::cmds::CheckFeatures::CheckFeatures()
|
||||||
cli::Name{"check-features"}, cli::Usage{"check-features"},
|
cli::Name{"check-features"}, cli::Usage{"check-features"},
|
||||||
cli::Description{"Check that the host system supports all necessary features"}} {
|
cli::Description{"Check that the host system supports all necessary features"}} {
|
||||||
|
|
||||||
action([this](const cli::Command::Context&) {
|
action([](const cli::Command::Context&) {
|
||||||
#if defined(CPU_FEATURES_ARCH_X86)
|
#if defined(CPU_FEATURES_ARCH_X86)
|
||||||
const auto info = cpu_features::GetX86Info();
|
const auto info = cpu_features::GetX86Info();
|
||||||
std::vector<std::string> missing_features;
|
std::vector<std::string> missing_features;
|
||||||
|
|
|
||||||
|
|
@ -20,9 +20,7 @@
|
||||||
|
|
||||||
namespace anbox {
|
namespace anbox {
|
||||||
namespace dbus {
|
namespace dbus {
|
||||||
Bus::Bus(Type type) :
|
Bus::Bus(Type type) {
|
||||||
type_{type} {
|
|
||||||
|
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case Type::Session:
|
case Type::Session:
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,6 @@ class Bus : public DoNotCopyOrMove {
|
||||||
private:
|
private:
|
||||||
void worker_main();
|
void worker_main();
|
||||||
|
|
||||||
Type type_;
|
|
||||||
sd_bus *bus_ = nullptr;
|
sd_bus *bus_ = nullptr;
|
||||||
std::thread worker_thread_;
|
std::thread worker_thread_;
|
||||||
std::atomic_bool running_{false};
|
std::atomic_bool running_{false};
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,12 @@ void ApplicationManager::launch(const android::Intent &intent,
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
throw std::runtime_error("Failed to construct DBus message");
|
throw std::runtime_error("Failed to construct DBus message");
|
||||||
|
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic warning "-Wpragmas"
|
||||||
|
#pragma GCC diagnostic warning "-Wc99-extensions"
|
||||||
sd_bus_error error = SD_BUS_ERROR_NULL;
|
sd_bus_error error = SD_BUS_ERROR_NULL;
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
|
||||||
r = sd_bus_call(bus_->raw(), m, 0, &error, nullptr);
|
r = sd_bus_call(bus_->raw(), m, 0, &error, nullptr);
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
const auto msg = utils::string_format("%s", error.message);
|
const auto msg = utils::string_format("%s", error.message);
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,6 @@ GLESv1Dispatch s_gles1;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
constexpr const char *default_egl_lib{"libEGL.so.1"};
|
constexpr const char *default_egl_lib{"libEGL.so.1"};
|
||||||
constexpr const char *default_glesv1_lib{"libGLESv1_CM.so.1"};
|
|
||||||
constexpr const char *default_glesv2_lib{"libGLESv2.so.2"};
|
constexpr const char *default_glesv2_lib{"libGLESv2.so.2"};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue