| 1 |
/* |
| 2 |
* Copyright (C) 2020 UBports foundation. |
| 3 |
* Author(s): Marius Gripsgard <[email protected]> |
| 4 |
* |
| 5 |
* This program is free software: you can redistribute it and/or modify it under |
| 6 |
* the terms of the GNU General Public License version 3, as published by |
| 7 |
* the Free Software Foundation. |
| 8 |
* |
| 9 |
* This program is distributed in the hope that it will be useful, but WITHOUT |
| 10 |
* ANY WARRANTY; without even the implied warranties of MERCHANTABILITY, |
| 11 |
* SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 |
* General Public License for more details. |
| 13 |
* |
| 14 |
* You should have received a copy of the GNU General Public License |
| 15 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 16 |
* |
| 17 |
*/ |
| 18 |
|
| 19 |
#include "platform.h" |
| 20 |
#include "linux.h" |
| 21 |
#ifdef HAVE_PROPS |
| 22 |
# include "halium.h" |
| 23 |
#endif |
| 24 |
|
| 25 |
std::shared_ptr<Platform> Platform::create() |
| 26 |
{ |
| 27 |
#ifdef HAVE_PROPS |
| 28 |
if (platform::Halium::usable()) |
| 29 |
return std::make_shared<platform::Halium>(); |
| 30 |
#endif |
| 31 |
|
| 32 |
// Linux is our fallback |
| 33 |
return std::make_shared<platform::Linux>(); |
| 34 |
} |