From 3fed45a76abf40c8fc8b986c19b80f9b185a2452 Mon Sep 17 00:00:00 2001 From: archshift Date: Fri, 15 May 2015 16:17:35 -0700 Subject: [PATCH] Added libcurl submodule and CMake code for building it. --- .gitmodules | 3 +++ .travis-deps.sh | 2 +- CMakeLists.txt | 23 ++++++++++++++++++++++- appveyor.yml | 2 +- externals/curl | 1 + src/citra/CMakeLists.txt | 2 +- src/citra_qt/CMakeLists.txt | 2 +- 7 files changed, 30 insertions(+), 5 deletions(-) create mode 160000 externals/curl diff --git a/.gitmodules b/.gitmodules index 598e4c64d..45f5df7b9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "nihstro"] path = externals/nihstro url = https://github.com/neobrain/nihstro.git +[submodule "curl"] + path = externals/curl + url = https://github.com/bagder/curl.git diff --git a/.travis-deps.sh b/.travis-deps.sh index f8074fb91..4e7403ad4 100755 --- a/.travis-deps.sh +++ b/.travis-deps.sh @@ -25,5 +25,5 @@ if [ "$TRAVIS_OS_NAME" = "linux" -o -z "$TRAVIS_OS_NAME" ]; then | sudo tar -xz -C /usr/local --strip-components=1 elif [ "$TRAVIS_OS_NAME" = "osx" ]; then brew tap homebrew/versions - brew install qt5 glfw3 pkgconfig + brew install qt5 glfw3 pkgconfig curl fi diff --git a/CMakeLists.txt b/CMakeLists.txt index b0fe285db..0dc5c9880 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,7 @@ # CMake 2.8.11 required for Qt5 settings to be applied automatically on # dependent libraries. cmake_minimum_required(VERSION 2.8.11) +include(ExternalProject) project(citra) @@ -123,7 +124,7 @@ IF (APPLE) FIND_LIBRARY(IOKIT_LIBRARY IOKit) # GLFW dependency FIND_LIBRARY(COREVIDEO_LIBRARY CoreVideo) # GLFW dependency set(PLATFORM_LIBRARIES iconv ${COCOA_LIBRARY} ${IOKIT_LIBRARY} ${COREVIDEO_LIBRARY}) - + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++") ELSEIF(MINGW) @@ -185,6 +186,26 @@ set(INI_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/externals/inih") include_directories(${INI_PREFIX}) add_subdirectory(${INI_PREFIX}) +find_package(CURL 7.28.0) +if (NOT CURL_FOUND) + set(CURL_SOURCE_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/externals/curl") + set(CURL_BUILT_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/externals/curl") + externalproject_add( + PREFIX SOURCE_DIR ${CURL_SOURCE_PREFIX} + CMAKE_CACHE_ARGS + -DBUILD_CURL_EXE:string=off + -DBUILD_CURL_TESTS:string=off + -DHTTP_ONLY:string=on + -DENABLE_MANUAL:string=off + -DCMAKE_INSTALL_PREFIX:string=${CURL_BUILT_PREFIX} + ) + include_directories("${CURL_BUILT_PREFIX}/include") + link_directories("${CURL_BUILT_PREFIX}/lib") + set(CURL_LIBRARIES "curl") +else() + include_directories(${CURL_INCLUDE_DIRS}) +endif() + include_directories(externals/nihstro/include) # process subdirectories diff --git a/appveyor.yml b/appveyor.yml index 7886b905b..722b607b3 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -16,7 +16,7 @@ configuration: - Release install: - - git submodule update --init --recursive --depth 20 + - git submodule update --init --recursive before_build: - mkdir build diff --git a/externals/curl b/externals/curl new file mode 160000 index 000000000..26cb9f164 --- /dev/null +++ b/externals/curl @@ -0,0 +1 @@ +Subproject commit 26cb9f1646e9b6be7925c18e439a683ca4c31555 diff --git a/src/citra/CMakeLists.txt b/src/citra/CMakeLists.txt index 713f49193..3dc9c9df8 100644 --- a/src/citra/CMakeLists.txt +++ b/src/citra/CMakeLists.txt @@ -16,6 +16,6 @@ create_directory_groups(${SRCS} ${HEADERS}) add_executable(citra ${SRCS} ${HEADERS}) target_link_libraries(citra core common video_core) target_link_libraries(citra ${GLFW_LIBRARIES} ${OPENGL_gl_LIBRARY} inih) -target_link_libraries(citra ${PLATFORM_LIBRARIES}) +target_link_libraries(citra ${PLATFORM_LIBRARIES} ${CURL_LIBRARIES}) #install(TARGETS citra RUNTIME DESTINATION ${bindir}) diff --git a/src/citra_qt/CMakeLists.txt b/src/citra_qt/CMakeLists.txt index ff780cad4..e739a99c9 100644 --- a/src/citra_qt/CMakeLists.txt +++ b/src/citra_qt/CMakeLists.txt @@ -71,6 +71,6 @@ else() endif() target_link_libraries(citra-qt core common video_core qhexedit) target_link_libraries(citra-qt ${OPENGL_gl_LIBRARY} ${CITRA_QT_LIBS}) -target_link_libraries(citra-qt ${PLATFORM_LIBRARIES}) +target_link_libraries(citra-qt ${PLATFORM_LIBRARIES} ${CURL_LIBRARIES}) #install(TARGETS citra-qt RUNTIME DESTINATION ${bindir})