[nostalgia] Switch from conan to vcpkg

This commit is contained in:
Gary Talent 2020-08-05 20:17:53 -05:00
parent 0b0fd151c8
commit be1a03c554
7 changed files with 14 additions and 33 deletions

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
.current_build .current_build
.vcpkg
compile_commands.json compile_commands.json
build build
conanbuild conanbuild

View File

@ -22,11 +22,6 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
include(GenerateExportHeader) include(GenerateExportHeader)
include(address_sanitizer) 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_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/dist/${NOSTALGIA_BUILD_CONFIG}")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

View File

@ -2,6 +2,7 @@ OS=$(shell uname | tr [:upper:] [:lower:])
HOST_ENV=${OS}-$(shell uname -m) HOST_ENV=${OS}-$(shell uname -m)
DEVENV=devenv$(shell pwd | sed 's/\//-/g') DEVENV=devenv$(shell pwd | sed 's/\//-/g')
DEVENV_IMAGE=nostalgia-devenv DEVENV_IMAGE=nostalgia-devenv
VCPKG_DIR=./.vcpkg/
CURRENT_BUILD=$(file < .current_build) CURRENT_BUILD=$(file < .current_build)
ifneq ($(shell which docker 2> /dev/null),) ifneq ($(shell which docker 2> /dev/null),)
ifeq ($(shell docker inspect --format="{{.State.Status}}" ${DEVENV} 2>&1),running) ifeq ($(shell docker inspect --format="{{.State.Status}}" ${DEVENV} 2>&1),running)
@ -84,20 +85,12 @@ devenv-destroy:
devenv-shell: devenv-shell:
${ENV_RUN} bash ${ENV_RUN} bash
ifeq ($(OS),linux) .PHONY: vcpkg
.PHONY: setup-conan vcpkg:
setup-conan: ${RM_RF} ${VCPKG_DIR}
conan profile update settings.compiler.libcxx=libstdc++11 default git clone https://github.com/microsoft/vcpkg ${VCPKG_DIR}
conan remote add -f bincrafters https://api.bintray.com/conan/bincrafters/public-conan ${VCPKG_DIR}/bootstrap-vcpkg.sh
else ${VCPKG_DIR}/vcpkg install sdl2 jsoncpp
.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: configure-release .PHONY: configure-release
configure-release: configure-release:

View File

@ -5,7 +5,6 @@
* Install GCC, Clang, or Visual Studio with C++17 support (including std::filesystem) * 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 [devkitPro](https://devkitpro.org/wiki/Getting_Started) to build for GBA
* Install Ninja, Make, and CMake * Install Ninja, Make, and CMake
* Install [Conan](https://conan.io/)
* Consider also installing ccache for faster subsequent build times * Consider also installing ccache for faster subsequent build times
## Platform Specific Setup ## 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 Build options: release, debug, asan, gba, gba-debug
make setup-conan make vcpkg
make purge conan configure-{gba,release,debug} install make purge configure-{gba,release,debug} install
## Run ## Run

View File

@ -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
#}

View File

@ -11,6 +11,7 @@ if [[ $target == gba ]]; then
toolchain="-DCMAKE_TOOLCHAIN_FILE=cmake/modules/GBA.cmake" toolchain="-DCMAKE_TOOLCHAIN_FILE=cmake/modules/GBA.cmake"
nostalgiaBuildType="GBA" nostalgiaBuildType="GBA"
else else
toolchain="-DCMAKE_TOOLCHAIN_FILE=.vcpkg/scripts/buildsystems/vcpkg.cmake"
nostalgiaBuildType="Native" nostalgiaBuildType="Native"
fi fi

View File

@ -4,11 +4,12 @@ add_library(
gfx.cpp gfx.cpp
) )
find_package(sdl2 REQUIRED) find_package(SDL2 REQUIRED)
target_link_libraries( target_link_libraries(
NostalgiaCore-SDL PUBLIC NostalgiaCore-SDL PUBLIC
sdl2::sdl2 SDL2::SDL2main
SDL2::SDL2-static
OxClaw OxClaw
OxFS OxFS
OxStd OxStd