From d3b8e6089ba3e093ee6aa5a5d1c164b8294e20e3 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Tue, 13 Feb 2018 19:20:20 -0600 Subject: [PATCH] Fix FS include path in Nostalgia --- .vscode/.cmaketools.json | 5 ++++ .vscode/settings.json | 8 +++++-- CMakeLists.txt | 10 ++++---- cmake/Modules/GBA.cmake | 5 ---- mg.yml | 35 ++++++++++++++++++++++++++++ src/nostalgia/core/gba/gfx.cpp | 2 +- src/nostalgia/core/gba/media.cpp | 2 +- src/nostalgia/studio/lib/project.cpp | 2 ++ 8 files changed, 56 insertions(+), 13 deletions(-) create mode 100644 .vscode/.cmaketools.json create mode 100644 mg.yml diff --git a/.vscode/.cmaketools.json b/.vscode/.cmaketools.json new file mode 100644 index 00000000..e8a5846b --- /dev/null +++ b/.vscode/.cmaketools.json @@ -0,0 +1,5 @@ +{ + "variant": null, + "activeEnvironments": [], + "codeModel": null +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index a0580486..817c0892 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,8 +1,12 @@ { "files.associations": { "iostream": "cpp", - "ostream": "cpp" + "ostream": "cpp", + "array": "cpp", + "initializer_list": "cpp", + "utility": "cpp" }, "editor.insertSpaces": false, - "editor.tabSize": 3 + "editor.tabSize": 3, + "git.ignoreLimitWarning": true } \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index c1873dd4..f1157176 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,9 +20,15 @@ if(NOSTALGIA_BUILD_TYPE STREQUAL "GBA") -fno-strict-aliasing -mthumb-interwork -mthumb + -std=c++17 ) +else() + set(CMAKE_CXX_STANDARD 14) endif() +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) + add_definitions( #-fdiagnostics-color # forces colored output when using ninja -Wall @@ -30,10 +36,6 @@ add_definitions( ) -set(CMAKE_CXX_STANDARD 14) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_CXX_EXTENSIONS OFF) - if(NOSTALGIA_IDE_BUILD STREQUAL "ON") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) diff --git a/cmake/Modules/GBA.cmake b/cmake/Modules/GBA.cmake index df290b56..27e84a96 100644 --- a/cmake/Modules/GBA.cmake +++ b/cmake/Modules/GBA.cmake @@ -1,10 +1,5 @@ set(CMAKE_SYSTEM_NAME "Generic") set(DEVKITARM $ENV{DEVKITARM}) -set(DEVKITPRO $ENV{DEVKITPRO}) - -if(NOT DEVKITPRO) - message(FATAL_ERROR "DEVKITPRO environment variable not set") -endif() if(NOT DEVKITARM) message(FATAL_ERROR "DEVKITARM environment variable not set") diff --git a/mg.yml b/mg.yml new file mode 100644 index 00000000..336593d8 --- /dev/null +++ b/mg.yml @@ -0,0 +1,35 @@ +--- +envs: + nostalgia_devenv: + dockerfile_path: ./Dockerfile +cmake: + .: + src_dir: . + build_dir: build/${target}-${build_type} + generator: Unix Makefiles + defs: + CMAKE_EXPORT_COMPILE_COMMANDS: ON + CMAKE_INSTALL_PREFIX: dist/${target}-${build_type} + CMAKE_INSTALL_RPATH: dist/${target}-${build_type} + NOSTALGIA_BUILD_TYPE: OFF + build_types: + release: + defs: + CMAKE_BUILD_TYPE: Release + debug: + defs: + USE_ASAN: ON + CMAKE_BUILD_TYPE: Debug + targets: + linux: + env: nostalgia_devenv + windows: + env: nostalgia_devenv + defs: + CMAKE_TOOLCHAIN_FILE: cmake/Modules/Mingw.cmake + gba: + env: nostalgia_devenv + defs: + CMAKE_TOOLCHAIN_FILE: cmake/Modules/GBA.cmake + NOSTALGIA_BUILD_TYPE: GBA + OX_USE_STDLIB: OFF diff --git a/src/nostalgia/core/gba/gfx.cpp b/src/nostalgia/core/gba/gfx.cpp index b447a47c..4693e812 100644 --- a/src/nostalgia/core/gba/gfx.cpp +++ b/src/nostalgia/core/gba/gfx.cpp @@ -6,7 +6,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include +#include #include #include "../media.hpp" diff --git a/src/nostalgia/core/gba/media.cpp b/src/nostalgia/core/gba/media.cpp index e2467115..0ef781af 100644 --- a/src/nostalgia/core/gba/media.cpp +++ b/src/nostalgia/core/gba/media.cpp @@ -6,7 +6,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include +#include #include #include "addresses.hpp" diff --git a/src/nostalgia/studio/lib/project.cpp b/src/nostalgia/studio/lib/project.cpp index 8f095f7c..90f17e6e 100644 --- a/src/nostalgia/studio/lib/project.cpp +++ b/src/nostalgia/studio/lib/project.cpp @@ -7,6 +7,7 @@ */ #include +#include #include "project.hpp" @@ -28,6 +29,7 @@ Project::~Project() { } void Project::create() { + qDebug() << "Project::create"; QDir().mkpath(m_path); auto buffSize = 1024;