diff --git a/.gitignore b/.gitignore index 3497dfaf..9bc69498 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .current_build +.vcpkg compile_commands.json build conanbuild diff --git a/CMakeLists.txt b/CMakeLists.txt index c9b2c620..eda664fd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,11 +22,6 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules) include(GenerateExportHeader) include(address_sanitizer) -set(NOSTALGIA_CONAN_PATHS ${CMAKE_SOURCE_DIR}/conanbuild/conan_paths.cmake) -if(NOT NOSTALGIA_BUILD_TYPE STREQUAL "GBA" AND EXISTS ${NOSTALGIA_CONAN_PATHS}) - include(${NOSTALGIA_CONAN_PATHS}) -endif() - set(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/dist/${NOSTALGIA_BUILD_CONFIG}") set(CMAKE_EXPORT_COMPILE_COMMANDS ON) diff --git a/Makefile b/Makefile index a088dbb8..4affea0b 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ OS=$(shell uname | tr [:upper:] [:lower:]) HOST_ENV=${OS}-$(shell uname -m) DEVENV=devenv$(shell pwd | sed 's/\//-/g') DEVENV_IMAGE=nostalgia-devenv +VCPKG_DIR=./.vcpkg/ CURRENT_BUILD=$(file < .current_build) ifneq ($(shell which docker 2> /dev/null),) ifeq ($(shell docker inspect --format="{{.State.Status}}" ${DEVENV} 2>&1),running) @@ -84,20 +85,12 @@ devenv-destroy: devenv-shell: ${ENV_RUN} bash -ifeq ($(OS),linux) -.PHONY: setup-conan -setup-conan: - conan profile update settings.compiler.libcxx=libstdc++11 default - conan remote add -f bincrafters https://api.bintray.com/conan/bincrafters/public-conan -else -.PHONY: setup-conan -setup-conan: - conan remote add -f bincrafters https://api.bintray.com/conan/bincrafters/public-conan -endif - -.PHONY: conan -conan: - @mkdir -p conanbuild && cd conanbuild && conan install ../ --build=missing +.PHONY: vcpkg +vcpkg: + ${RM_RF} ${VCPKG_DIR} + git clone https://github.com/microsoft/vcpkg ${VCPKG_DIR} + ${VCPKG_DIR}/bootstrap-vcpkg.sh + ${VCPKG_DIR}/vcpkg install sdl2 jsoncpp .PHONY: configure-release configure-release: diff --git a/README.md b/README.md index 16a16b61..292125f3 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,6 @@ * Install GCC, Clang, or Visual Studio with C++17 support (including std::filesystem) * Install [devkitPro](https://devkitpro.org/wiki/Getting_Started) to build for GBA * Install Ninja, Make, and CMake -* Install [Conan](https://conan.io/) * Consider also installing ccache for faster subsequent build times ## Platform Specific Setup @@ -18,8 +17,8 @@ Install and use gmake instead of the make that comes with the system. Build options: release, debug, asan, gba, gba-debug - make setup-conan - make purge conan configure-{gba,release,debug} install + make vcpkg + make purge configure-{gba,release,debug} install ## Run diff --git a/conanfile.py b/conanfile.py deleted file mode 100644 index 40ed8831..00000000 --- a/conanfile.py +++ /dev/null @@ -1,9 +0,0 @@ -from conans import ConanFile, CMake - -class NostalgiaConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - requires = "jsoncpp/1.9.2", "sdl2/2.0.10@bincrafters/stable" - generators = "cmake", "cmake_find_package", "cmake_paths" - #default_options = { - # "sdl2:nas": False - #} diff --git a/scripts/setup-build b/scripts/setup-build index 9582279e..9bc8156d 100755 --- a/scripts/setup-build +++ b/scripts/setup-build @@ -11,6 +11,7 @@ if [[ $target == gba ]]; then toolchain="-DCMAKE_TOOLCHAIN_FILE=cmake/modules/GBA.cmake" nostalgiaBuildType="GBA" else + toolchain="-DCMAKE_TOOLCHAIN_FILE=.vcpkg/scripts/buildsystems/vcpkg.cmake" nostalgiaBuildType="Native" fi diff --git a/src/nostalgia/core/sdl/CMakeLists.txt b/src/nostalgia/core/sdl/CMakeLists.txt index 15ecbc91..c235ddd4 100644 --- a/src/nostalgia/core/sdl/CMakeLists.txt +++ b/src/nostalgia/core/sdl/CMakeLists.txt @@ -4,11 +4,12 @@ add_library( gfx.cpp ) -find_package(sdl2 REQUIRED) +find_package(SDL2 REQUIRED) target_link_libraries( NostalgiaCore-SDL PUBLIC - sdl2::sdl2 + SDL2::SDL2main + SDL2::SDL2-static OxClaw OxFS OxStd