diff --git a/.gitignore b/.gitignore index 1f40a23e..d44d4288 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,9 @@ .clangd .current_build -.vcpkg scripts/__pycache__ compile_commands.json build -conanbuild +.conanbuild dist tags nostalgia.gba diff --git a/CMakeLists.txt b/CMakeLists.txt index f6d2bfae..7cc95148 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,6 +20,11 @@ if(NOSTALGIA_BUILD_TYPE STREQUAL "GBA") set(OX_BARE_METAL ON) endif() +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() + if(OX_BARE_METAL) set(NOSTALGIA_BUILD_STUDIO OFF) set(OX_USE_STDLIB OFF) diff --git a/README.md b/README.md index 0c869f49..2b83ccbf 100644 --- a/README.md +++ b/README.md @@ -19,8 +19,8 @@ Install and use gmake instead of the make that comes with the system. Build options: release, debug, asan, gba, gba-debug - make vcpkg - make purge configure-{gba,release,debug} install + make setup-conan + make purge conan configure-{gba,release,debug} install ## Run diff --git a/conanfile.py b/conanfile.py new file mode 100644 index 00000000..96ac238c --- /dev/null +++ b/conanfile.py @@ -0,0 +1,9 @@ +from conans import ConanFile, CMake + +class NostalgiaConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + requires = "jsoncpp/1.9.4", "sdl2/2.0.14@bincrafters/stable" + generators = "cmake", "cmake_find_package", "cmake_paths" + #default_options = { + # "sdl2:nas": False + #} diff --git a/src/nostalgia/core/sdl/CMakeLists.txt b/src/nostalgia/core/sdl/CMakeLists.txt index 562922e9..17f03dab 100644 --- a/src/nostalgia/core/sdl/CMakeLists.txt +++ b/src/nostalgia/core/sdl/CMakeLists.txt @@ -4,12 +4,11 @@ add_library( gfx.cpp ) -find_package(SDL2 REQUIRED) +find_package(sdl2 REQUIRED) target_link_libraries( NostalgiaCore-SDL PUBLIC - SDL2::SDL2main - SDL2::SDL2-static + SDL2::SDL2 NostalgiaCore-Userspace )