From f430d6d39805957a532d82c0f286922c112a553c Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Fri, 2 Feb 2018 01:15:53 -0600 Subject: [PATCH] Update nostalgia to work with file system changes --- .vscode/c_cpp_properties.json | 8 +- .vscode/tasks.json | 2 +- scripts/setup-build.ps1 | 10 +- src/nostalgia/Makefile | 196 +++++++++++++++++++++- src/nostalgia/core/context.hpp | 2 +- src/nostalgia/core/core.hpp | 2 +- src/nostalgia/studio/lib/oxfstreeview.hpp | 2 +- src/nostalgia/studio/lib/project.hpp | 2 +- src/nostalgia/tools/lib/tilesetimport.cpp | 2 +- src/nostalgia/tools/pack.cpp | 2 +- 10 files changed, 211 insertions(+), 17 deletions(-) diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 614fd0c1..6da75c5b 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -33,15 +33,15 @@ "includePath": [ "/usr/include", "/usr/local/include", - "${workspaceRoot}", "/usr/include/c++/6", "/usr/include/x86_64-linux-gnu/c++/6", "/usr/include/x86_64-linux-gnu/qt5/QtCore", "/usr/include/x86_64-linux-gnu/qt5", - "${workspaceRoot}/deps/ox/src", + "/usr/include/x86_64-linux-gnu/qt5/QtWidgets", "/usr/lib/llvm-3.8/lib/clang/3.8.1/include", + "${workspaceRoot}/deps/ox/src", "${workspaceRoot}/src", - "/usr/include/x86_64-linux-gnu/qt5/QtWidgets" + "/usr/include/x86_64-linux-gnu/qt5/QtGui" ], "defines": [], "intelliSenseMode": "clang-x64", @@ -52,7 +52,7 @@ "${workspaceRoot}" ], "limitSymbolsToIncludedHeaders": true, - "databaseFilename": "" + "databaseFilename": "${workspaceRoot}/build/current/compile_commands.json" } }, { diff --git a/.vscode/tasks.json b/.vscode/tasks.json index e72e169a..0620d280 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -6,7 +6,7 @@ { "label": "build", "type": "shell", - "command": "cmake --build ${workspaceFolder}/build/current --target install", + "command": "cmake --build ${workspaceFolder}/build/current --target install -- -j", "group": { "kind": "build", "isDefault": true diff --git a/scripts/setup-build.ps1 b/scripts/setup-build.ps1 index d796cbae..d253ee43 100755 --- a/scripts/setup-build.ps1 +++ b/scripts/setup-build.ps1 @@ -5,7 +5,7 @@ Param( [parameter(Mandatory=$true,Position=1)][String] ${buildType} ) -$project=(Get-Location) +$project=(Get-Location).Path if (${target} -eq "windows") { $toolchain="-DCMAKE_TOOLCHAIN_FILE=cmake/Modules/Mingw.cmake" @@ -21,8 +21,8 @@ if (${buildType} -eq "asan") { $buildTypeArgs="-DCMAKE_BUILD_TYPE=Release" } -$buildDir="build/${target}-${buildType}" -$distDir="../../dist/${target}-${buildType}" +$buildDir="${project}/build/${target}-${buildType}" +$distDir="${project}/dist/${target}-${buildType}" New-Item -ItemType Directory -Path $buildDir | Out-Null Push-Location $buildDir @@ -37,6 +37,8 @@ cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ` Pop-Location rm -f build/current dist/current -New-Item -ItemType Directory -Path dist | Out-Null +if (!(Test-Path -Path dist)) { + New-Item -ItemType Directory -Path dist | Out-Null +} ln -s ${target}-${buildType} build/current ln -s ${target}-${buildType} dist/current diff --git a/src/nostalgia/Makefile b/src/nostalgia/Makefile index c289a79d..5580c8f5 100644 --- a/src/nostalgia/Makefile +++ b/src/nostalgia/Makefile @@ -1,2 +1,194 @@ -make: - make -j -C ../ ${ARGS} +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.7 + +# Default target executed when no arguments are given to make. +default_target: all + +.PHONY : default_target + +# Allow only one "make -f Makefile2" at a time, but pass parallelism. +.NOTPARALLEL: + + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/bin/cmake + +# The command to remove a file. +RM = /usr/bin/cmake -E remove -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /home/gary/projects/nostalgia + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /home/gary/projects/nostalgia + +#============================================================================= +# Targets provided globally by CMake. + +# Special rule for the target install/strip +install/strip: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." + /usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake +.PHONY : install/strip + +# Special rule for the target install/strip +install/strip/fast: install/strip + +.PHONY : install/strip/fast + +# Special rule for the target install/local +install/local: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." + /usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake +.PHONY : install/local + +# Special rule for the target install/local +install/local/fast: install/local + +.PHONY : install/local/fast + +# Special rule for the target test +test: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running tests..." + /usr/bin/ctest --force-new-ctest-process $(ARGS) +.PHONY : test + +# Special rule for the target test +test/fast: test + +.PHONY : test/fast + +# Special rule for the target edit_cache +edit_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "No interactive CMake dialog available..." + /usr/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available. +.PHONY : edit_cache + +# Special rule for the target edit_cache +edit_cache/fast: edit_cache + +.PHONY : edit_cache/fast + +# Special rule for the target rebuild_cache +rebuild_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." + /usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : rebuild_cache + +# Special rule for the target rebuild_cache +rebuild_cache/fast: rebuild_cache + +.PHONY : rebuild_cache/fast + +# Special rule for the target install +install: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." + /usr/bin/cmake -P cmake_install.cmake +.PHONY : install + +# Special rule for the target install +install/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." + /usr/bin/cmake -P cmake_install.cmake +.PHONY : install/fast + +# Special rule for the target list_install_components +list_install_components: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\"" +.PHONY : list_install_components + +# Special rule for the target list_install_components +list_install_components/fast: list_install_components + +.PHONY : list_install_components/fast + +# The main all target +all: cmake_check_build_system + cd /home/gary/projects/nostalgia && $(CMAKE_COMMAND) -E cmake_progress_start /home/gary/projects/nostalgia/CMakeFiles /home/gary/projects/nostalgia/src/nostalgia/CMakeFiles/progress.marks + cd /home/gary/projects/nostalgia && $(MAKE) -f CMakeFiles/Makefile2 src/nostalgia/all + $(CMAKE_COMMAND) -E cmake_progress_start /home/gary/projects/nostalgia/CMakeFiles 0 +.PHONY : all + +# The main clean target +clean: + cd /home/gary/projects/nostalgia && $(MAKE) -f CMakeFiles/Makefile2 src/nostalgia/clean +.PHONY : clean + +# The main clean target +clean/fast: clean + +.PHONY : clean/fast + +# Prepare targets for installation. +preinstall: all + cd /home/gary/projects/nostalgia && $(MAKE) -f CMakeFiles/Makefile2 src/nostalgia/preinstall +.PHONY : preinstall + +# Prepare targets for installation. +preinstall/fast: + cd /home/gary/projects/nostalgia && $(MAKE) -f CMakeFiles/Makefile2 src/nostalgia/preinstall +.PHONY : preinstall/fast + +# clear depends +depend: + cd /home/gary/projects/nostalgia && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 +.PHONY : depend + +# Help Target +help: + @echo "The following are some of the valid targets for this Makefile:" + @echo "... all (the default if no target is provided)" + @echo "... clean" + @echo "... depend" + @echo "... install/strip" + @echo "... install/local" + @echo "... test" + @echo "... edit_cache" + @echo "... rebuild_cache" + @echo "... install" + @echo "... list_install_components" +.PHONY : help + + + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + cd /home/gary/projects/nostalgia && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/src/nostalgia/core/context.hpp b/src/nostalgia/core/context.hpp index b73b83e8..e1718e61 100644 --- a/src/nostalgia/core/context.hpp +++ b/src/nostalgia/core/context.hpp @@ -6,7 +6,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include +#include namespace nostalgia { namespace core { diff --git a/src/nostalgia/core/core.hpp b/src/nostalgia/core/core.hpp index e888ea9f..da54ef87 100644 --- a/src/nostalgia/core/core.hpp +++ b/src/nostalgia/core/core.hpp @@ -8,7 +8,7 @@ #pragma once -#include +#include #include "gfx.hpp" #include "media.hpp" diff --git a/src/nostalgia/studio/lib/oxfstreeview.hpp b/src/nostalgia/studio/lib/oxfstreeview.hpp index 0e30c524..ee423cce 100644 --- a/src/nostalgia/studio/lib/oxfstreeview.hpp +++ b/src/nostalgia/studio/lib/oxfstreeview.hpp @@ -12,7 +12,7 @@ #include #include -#include +#include namespace nostalgia { namespace studio { diff --git a/src/nostalgia/studio/lib/project.hpp b/src/nostalgia/studio/lib/project.hpp index b9d6ad83..48ae6a06 100644 --- a/src/nostalgia/studio/lib/project.hpp +++ b/src/nostalgia/studio/lib/project.hpp @@ -10,7 +10,7 @@ #include -#include +#include #include namespace nostalgia { diff --git a/src/nostalgia/tools/lib/tilesetimport.cpp b/src/nostalgia/tools/lib/tilesetimport.cpp index 291b0539..d9a49120 100644 --- a/src/nostalgia/tools/lib/tilesetimport.cpp +++ b/src/nostalgia/tools/lib/tilesetimport.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include diff --git a/src/nostalgia/tools/pack.cpp b/src/nostalgia/tools/pack.cpp index efa46f26..8f53a393 100644 --- a/src/nostalgia/tools/pack.cpp +++ b/src/nostalgia/tools/pack.cpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include using namespace std; using namespace ox;