From 1e1b20c889a53d24cfc37880bf6e6bba46f2ae78 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Wed, 22 Nov 2017 23:32:08 +0100 Subject: Add AppVeyor CI for automatic Windows Builds We already have automatic Linux and macOS build via Travis CI. This adds the same for Windows x86 and x86_64 with both Microsoft Visual Studio 2015 as well as MinGW-w64. --- appveyor.yml | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 appveyor.yml (limited to 'appveyor.yml') diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 00000000..36f161c3 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,65 @@ +#os: Visual Studio 2015 + +clone_depth: 5 + +cache: + - C:\ProgramData\chocolatey\bin -> appveyor.yml + - C:\ProgramData\chocolatey\lib -> appveyor.yml + +init: + - cmake -E remove c:\programdata\chocolatey\bin\cpack.exe + - set PATH=%PATH:C:\Program Files (x86)\Git\usr\bin;=% + - set PATH=%PATH:C:\Program Files\Git\usr\bin;=% + - set PATH=%prefix_dir%\bin;%PATH% + +environment: + matrix: + - compiler: MinGW-w64 + bits: 32 + prefix_dir: C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32 + - compiler: MinGW-w64 + bits: 64 + prefix_dir: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64 + - compiler: MSVC15 + bits: 32 + - compiler: MSVC15 + bits: 64 + +before_build: + - appveyor DownloadFile http://openal-soft.org/openal-binaries/openal-soft-1.17.2-bin.zip + - 7z x openal-soft-1.17.2-bin.zip + - move openal-soft-1.17.2-bin src\external\openal + - if [%COMPILER%]==[MinGW-w64] set CFLAGS=-m%BITS% & set LDFLAGS=-m%BITS% & set GENERATOR="MinGW Makefiles" + - if [%COMPILER%]==[MSVC15] if [%BITS%]==[32] set GENERATOR="Visual Studio 14 2015" + - if [%COMPILER%]==[MSVC15] if [%BITS%]==[64] set GENERATOR="Visual Studio 14 2015 Win64" + - set VERBOSE=1 + - mkdir build + - cd build + +build_script: + - cmake -G %GENERATOR% -DBUILD_EXAMPLES=OFF -DBUILD_GAMES=OFF .. + - cmake --build . --target install + +after_build: +# - cmake --build . --target package + +before_test: + +test_script: + +#artifacts: +# - path: 'build\*.zip' +# +#deploy: +# description: 'Automatic build by CI' +# provider: GitHub +# auth_token: +# secure: XXX +# artifact: /.*\.zip/ +# draft: false +# prerelease: false +# force_update: true +# on: +# branch: master +# appveyor_repo_tag: true # deploy on tag push only +# -- cgit v1.2.3 From 44376c04fa8ed5bc9ca48598afa1d177d169fa32 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Wed, 11 Oct 2017 22:33:09 +0200 Subject: Generate and install pkg-config pc file After installation, compiling new programs is possible with $ cc game.c `pkg-config --static --libs --cflags raylib` or $ cc game.c `pkg-config --libs --cflags raylib` depending on configuration Also adds following configuration options: - WITH_PIC "Compile static library as position-independent code" - STATIC_RAYLIB "Build raylib as a static library" - MACOS_FATLIB "Build fat library for both i386 and x86_64 on macOS" --- .travis.yml | 8 ++-- appveyor.yml | 2 +- raylib.pc.in | 13 ++++++ src/CMakeLists.txt | 124 +++++++++++++++++++++++++++++++++++------------------ utils.cmake | 40 ++++++++--------- 5 files changed, 117 insertions(+), 70 deletions(-) create mode 100644 raylib.pc.in (limited to 'appveyor.yml') diff --git a/.travis.yml b/.travis.yml index 8b122c47..ce4998c7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,9 +13,9 @@ env: global: - VERBOSE=1 matrix: - - CFLAGS=-m64 - - CFLAGS=-m32 - + - CFLAGS=-m64 SHARED=ON + - CFLAGS=-m32 SHARED=OFF +# We don't install x11 32-bit libraries, so skip shared libraries on -m32 before_script: - export CFLAGS="-std=gnu99 $CFLAGS" @@ -32,7 +32,7 @@ before_install: script: - mkdir build - cd build - - cmake -DBUILD_EXAMPLES=OFF -DBUILD_GAMES=OFF .. + - cmake -DSTATIC_RAYLIB=ON -DSHARED_RAYLIB=$SHARED -DBUILD_EXAMPLES=OFF -DBUILD_GAMES=OFF .. - make # - make package # - sudo make install diff --git a/appveyor.yml b/appveyor.yml index 36f161c3..864d0c68 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -37,7 +37,7 @@ before_build: - cd build build_script: - - cmake -G %GENERATOR% -DBUILD_EXAMPLES=OFF -DBUILD_GAMES=OFF .. + - cmake -G %GENERATOR% -DSTATIC_RAYLIB=ON -DSHARED_RAYLIB=OFF -DBUILD_EXAMPLES=OFF -DBUILD_GAMES=OFF .. - cmake --build . --target install after_build: diff --git a/raylib.pc.in b/raylib.pc.in new file mode 100644 index 00000000..0472c283 --- /dev/null +++ b/raylib.pc.in @@ -0,0 +1,13 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: raylib +Description: Simple and easy-to-use library to learn videogames programming +URL: https://github.com/raysan5/raylib +Version: @PROJECT_VERSION@ +Libs: -L${libdir} -lraylib +Libs.private:@PKG_CONFIG_LIBS_PRIVATE@ +Requires.private: +Cflags: -I${includedir} diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6ab8e606..b29c29fc 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -8,8 +8,17 @@ set(RAYLIB raylib) # Name of the generated library ### Config options ### -# Build a static or shared raylib? +# Shared library is always PIC. Static library should be PIC too if linked into a shared library +set(WITH_PIC OFF CACHE BOOL "Compile static library as position-independent code" OFF) +# Build a static and/or shared raylib? set(SHARED_RAYLIB OFF CACHE BOOL "Build raylib as a dynamic library") +set(STATIC_RAYLIB ON CACHE BOOL "Build raylib as a static library") +set(MACOS_FATLIB ON CACHE BOOL "Build fat library for both i386 and x86_64 on macOS") + +if(NOT (STATIC_RAYLIB OR SHARED_RAYLIB)) + message(FATAL_ERROR "Nothing to do if both -DSHARED_RAYLIB=OFF and -DSTATIC_RAYLIB=OFF...") +endif() + # Platform set(PLATFORM "Desktop" CACHE STRING "Platform to build for.") @@ -66,6 +75,14 @@ elseif(${PLATFORM} MATCHES "Raspberry Pi") set(GRAPHICS "GRAPHICS_API_OPENGL_ES2") endif() +if(BUILD_MACOS_FATLIB) + if (CMAKE_OSX_ARCHITECTURES) + message(FATAL_ERROR "User supplied -DCMAKE_OSX_ARCHITECTURES overrides BUILD_MACOS_FATLIB=ON") + else() + SET(CMAKE_OSX_ARCHITECTURES "x86_64;i386") + endif() +endif() + # Get the sources together file(GLOB raylib_sources *.c) file(GLOB stb_vorbis external/stb_vorbis.c) @@ -73,40 +90,72 @@ set(sources ${raylib_sources} ${stb_vorbis}) # Which platform? if(${PLATFORM} MATCHES "PLATFORM_DESKTOP") - # Build a static or shared raylib? - # TODO clean this up a bit? - if(${SHARED_RAYLIB}) - # Shared library - add_library(${RAYLIB} SHARED ${sources}) - - # Will link -framework (if on OS X) - link_os_x_frameworks(raylib) - else() - # Static library - add_library(${RAYLIB} STATIC ${sources}) - - if(LINUX) - # On Linux, need to link a few extra things for static - target_link_libraries(${RAYLIB} m pthread dl) - target_link_libraries(${RAYLIB} X11 Xrandr Xinerama Xi Xxf86vm Xcursor) # X11 stuff - endif() - endif() - - # Always need to link OpenAL and OpenGL + if(LINUX) - # Elsewhere (such as Linux), need `-lopenal -lGL` - target_link_libraries(${RAYLIB} openal) - target_link_libraries(${RAYLIB} GL) + foreach(L ${LIBS_PRIVATE}) + set(PKG_CONFIG_LIBS_PRIVATE "${PKG_CONFIG_LIBS_PRIVATE} -l${L}") + endforeach(L) + + elseif(APPLE) + # TODO extract framework location and name from ${LIBS_PRIVATE} + # and specify them as -F and -framework instead of hardcoding + foreach(F OpenGL OpenAL Cocoa) + set(PKG_CONFIG_LIBS_PRIVATE "${PKG_CONFIG_LIBS_PRIVATE} -framework ${F}") + endforeach(F) + endif() - - # Library file & Header - set_target_properties(${RAYLIB} PROPERTIES PUBLIC_HEADER "raylib.h") - install( - TARGETS ${RAYLIB} - ARCHIVE DESTINATION lib - LIBRARY DESTINATION lib - PUBLIC_HEADER DESTINATION include - ) + + if(${SHARED_RAYLIB}) + add_library(${RAYLIB}_shared SHARED ${sources}) + + target_compile_definitions(${RAYLIB}_shared + PUBLIC ${PLATFORM} + PUBLIC ${GRAPHICS} + ) + + set_property(TARGET ${RAYLIB}_shared PROPERTY POSITION_INDEPENDENT_CODE ON) + set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") + set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + set(CMAKE_MACOSX_RPATH ON) + + target_link_libraries(${RAYLIB}_shared ${LIBS_PRIVATE}) + set_target_properties(${RAYLIB}_shared PROPERTIES PUBLIC_HEADER "raylib.h") + if(WIN32) + install( + TARGETS ${RAYLIB}_shared + RUNTIME DESTINATION lib + PUBLIC_HEADER DESTINATION include + ) + else() # Keep lib*.(a|dll) name, but avoid *.lib files overwriting each other on Windows + set_target_properties(${RAYLIB}_shared PROPERTIES OUTPUT_NAME ${RAYLIB}) + install( + TARGETS ${RAYLIB}_shared + LIBRARY DESTINATION lib + PUBLIC_HEADER DESTINATION include + ) + endif() + endif(${SHARED_RAYLIB}) + + if(${STATIC_RAYLIB}) + add_library(${RAYLIB} STATIC ${sources}) + + target_compile_definitions(${RAYLIB} + PUBLIC ${PLATFORM} + PUBLIC ${GRAPHICS} + ) + + if (WITH_PIC) + set_property(TARGET ${RAYLIB} PROPERTY POSITION_INDEPENDENT_CODE ON) + endif() + set_target_properties(${RAYLIB} PROPERTIES PUBLIC_HEADER "raylib.h") + install(TARGETS ${RAYLIB} + ARCHIVE DESTINATION lib + PUBLIC_HEADER DESTINATION include + ) + endif(${STATIC_RAYLIB}) + + configure_file(../raylib.pc.in raylib.pc @ONLY) + install(FILES ${CMAKE_BINARY_DIR}/release/raylib.pc DESTINATION lib/pkgconfig) # Copy the header files to the build directory file(COPY "raylib.h" DESTINATION ".") @@ -119,15 +168,6 @@ elseif(${PLATFORM} MATCHES "PLATFORM_WEB") add_executable(${RAYLIB} ${sources}) endif() - -# Set the compile flags to raylib -target_compile_definitions(${RAYLIB} - PUBLIC ${PLATFORM} - PUBLIC ${GRAPHICS} -) - - - # Print the flags for the user message(STATUS "Compiling with the flags:") message(STATUS " PLATFORM=" ${PLATFORM}) diff --git a/utils.cmake b/utils.cmake index f260fa5e..54221b9c 100644 --- a/utils.cmake +++ b/utils.cmake @@ -1,5 +1,5 @@ # All sorts of things that we need cross project -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 2.8.0) # Detect linux if(UNIX AND NOT APPLE) @@ -8,33 +8,27 @@ endif() # Linking for OS X -framework options # Will do nothing on other OSes -function(link_os_x_frameworks binary) - if(APPLE) - find_library(OPENGL_LIBRARY OpenGL) - find_library(OPENAL_LIBRARY OpenAL) - find_library(COCOA_LIBRARY Cocoa) - - set(OSX_FRAMEWORKS ${OPENGL_LIBRARY} ${OPENAL_LIBRARY} ${COCOA_LIBRARY}) - target_link_libraries(${binary} ${OSX_FRAMEWORKS}) - endif() -endfunction() +if(APPLE) + find_library(OPENGL_LIBRARY OpenGL) + find_library(OPENAL_LIBRARY OpenAL) + find_library(COCOA_LIBRARY Cocoa) + set(LIBS_PRIVATE ${OPENGL_LIBRARY} ${OPENAL_LIBRARY} ${COCOA_LIBRARY}) +elseif(LINUX) + # Elsewhere (such as Linux), need `-lopenal -lGL`, etc... + set(LIBS_PRIVATE + m pthread dl + openal + GL + X11 Xrandr Xinerama Xi Xxf86vm Xcursor) # X11 stuff +else() + # TODO Windows +endif() # Do the linking for executables that are meant to link raylib function(link_libraries_to_executable executable) # Link the libraries - if(APPLE) - # OS X, we use frameworks - link_os_x_frameworks(${executable}) - elseif(LINUX) - # Elsewhere (such as Linux), need `-lopenal -lGL`, etc... - target_link_libraries(${executable} m pthread dl) - target_link_libraries(${executable} openal) - target_link_libraries(${executable} GL) - target_link_libraries(${executable} X11 Xrandr Xinerama Xi Xxf86vm Xcursor) # X11 stuff - else() - # TODO windows - endif() + target_link_libraries(${executable} ${LIBS_PRIVATE}) # And raylib target_link_libraries(${executable} raylib) -- cgit v1.2.3 From 49c5a433df48c1b9efafb70e51724c2fc3a5e608 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Fri, 24 Nov 2017 19:57:44 +0100 Subject: Setup CMake package target and CI auto-deploy tags cmake --build . --target package # or make package if make is used can now be used to create binary packages for raylib. AppVeyor and Travis CI are configured to push the artifacts that result from building git tags to the related Github releases page. --- .travis.yml | 52 ++++++++++++++++++++++++++++-------------------- README.md | 10 ++++++---- appveyor.yml | 58 ++++++++++++++++++++++++++++-------------------------- raylib.pc.in | 2 +- src/CMakeLists.txt | 16 +++++++++++++-- 5 files changed, 82 insertions(+), 56 deletions(-) (limited to 'appveyor.yml') diff --git a/.travis.yml b/.travis.yml index ce4998c7..40817fba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,38 +12,48 @@ os: env: global: - VERBOSE=1 - matrix: - - CFLAGS=-m64 SHARED=ON - - CFLAGS=-m32 SHARED=OFF -# We don't install x11 32-bit libraries, so skip shared libraries on -m32 + matrix: # We don't install x11 32-bit libraries, so skip shared libraries on -m32 + - ARCH=i386 SHARED=OFF + - ARCH=amd64 SHARED=ON + +matrix: + exclude: # This is already covered by building universal (fat) libraries by default + - os: osx + env: ARCH=i386 SHARED=OFF + before_script: - - export CFLAGS="-std=gnu99 $CFLAGS" + - export CFLAGS="-std=gnu99" before_install: - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -y gcc-multilib libopenal-dev libxcursor-dev libxinerama-dev - mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev libglew-dev; + mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev + libgl1-mesa-dev libglu1-mesa-dev libglew-dev; + export RAYLIB_PACKAGE_SUFFIX="-Linux-$ARCH"; + if [ "$ARCH" == "i386" ]; then export CFLAGS="$CFLAGS -m32"; fi; + if [ "$ARCH" == "amd64" ]; then export CFLAGS="$CFLAGS -m64"; fi; fi - - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update; brew install glfw; fi + - if [ "$TRAVIS_OS_NAME" == "osx" ]; then export RAYLIB_PACKAGE_SUFFIX="-macOS"; fi - "$CC --version" script: - mkdir build - cd build - - cmake -DSTATIC_RAYLIB=ON -DSHARED_RAYLIB=$SHARED -DBUILD_EXAMPLES=OFF -DBUILD_GAMES=OFF .. + - cmake -DMACOS_FATLIB=ON -DSTATIC_RAYLIB=ON -DSHARED_RAYLIB=$SHARED -DBUILD_EXAMPLES=OFF -DBUILD_GAMES=OFF .. - make -# - make package -# - sudo make install -# -#deploy: -# provider: releases -# api_key: -# secure: XXX -# file_glob: true -# file: raylib-*.tar.gz -# skip_cleanup: true -# on: -# branch: master -# tags: true + - make package + +deploy: + provider: releases + api_key: + secure: LvqUIAN/3dJul+Ra2iK3tSaNG5IwsNMmGIwVMy0DK5IBCxiQPBc9pWGiE30RTBPt6Z+N4BhMEE8DtUl+vnISlMoHWNIIhF2zwC66hs/F7zY7qEITMRSmfiLcqxQysknFOnJB06CATgXcFqlEo9j+t4abrG/f3qcb92J4O2uNz336Au2myTx93Q5MxbyA7KiUuEutFnb2dWiPCY4d+sGeXEfsiD2R7aj/8MaWOkoGdZVrTkI9juMgvpImkjQBArvqdjUMeT3MsRrwgOIq5v2GFV9dOl8k1WzPeT8B2JHh00ed/o1/wuFq/cLLOxtYo2+Pv3+xatOrlexoX0WkDm7C9/L1W5U4rLexU3CQ9mMBmHPnp6k/WXZ5QXEE4uUF0+LpN3XlIXzFpdZmZiVV8VLxg2WvyncMmivYiu7/MTkyfZxyKkzwl7sZZslzHA9kOGedGaN7b7/2B77OFHoQK8lKfdFml7jJnarh+89nenNZYMab0E8qkOJOyb2bYlDTa0/2nyxGiyymYgq6YHLNrDbhqB/1LzdgzjMliQ8ri5q9Ux2vjfcqOzhfAmcwFwnY/D6yXJWYi0DWpHZdpKl3du6dYDrypW91/yDWbwiJ/YhrE7ZunzrcB6GH/QkbuzWxdCth39rQAHih8DG01co/K3Gvi4yGjvIH5tFUpyEolMnpMiA= + file_glob: true + file: raylib-*.tar.gz + skip_cleanup: true + on: + repo: raysan5/raylib + branch: + - develop + - master diff --git a/README.md b/README.md index 0be62fda..1c078f52 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ features * Audio loading and playing with streaming support (WAV, OGG, FLAC, XM, MOD) * Multiple platforms support: Windows, Linux, Mac, **Android**, **Raspberry Pi** and **HTML5** * VR stereo rendering support with configurable HMD device parameters - * Minimal external dependencies (GLFW3, OpenGL, OpenAL) + * Minimal external dependencies (OpenGL, OpenAL) * Complete bindings to LUA ([raylib-lua](https://github.com/raysan5/raylib-lua)) and Go ([raylib-go](https://github.com/gen2brain/raylib-go)) raylib uses on its core module the outstanding [GLFW3](http://www.glfw.org/) library. The best option I found for @@ -44,10 +44,12 @@ to accomodate to Android, Raspberry Pi and HTML5. *On Raspberry Pi, Videocore API and EGL libraries are used for window/context management and raw inputs reading.* -building --------- +build and installation +---------------------- + +Binary releases for Windows, Linux and macOS are available at the [Github Releases](https://github.com/raysan5/raylib/releases) page. -For detailed building instructions, check [raylib Wiki](https://github.com/raysan5/raylib/wiki). +To build raylib yourself, check out the [raylib Wiki](https://github.com/raysan5/raylib/wiki) for detailed instructions. raylib has been developed using exclusively two tools: diff --git a/appveyor.yml b/appveyor.yml index 864d0c68..2363bd3f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -10,29 +10,30 @@ init: - cmake -E remove c:\programdata\chocolatey\bin\cpack.exe - set PATH=%PATH:C:\Program Files (x86)\Git\usr\bin;=% - set PATH=%PATH:C:\Program Files\Git\usr\bin;=% - - set PATH=%prefix_dir%\bin;%PATH% + - if [%BITS%]==[32] set MINGW=C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32 + - if [%BITS%]==[64] set MINGW=C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64 + - if [%COMPILER%]==[mingw] set PATH=%MINGW%\bin;%PATH% + - set RAYLIB_PACKAGE_SUFFIX=-Win%BITS%-%COMPILER% + - set VERBOSE=1 environment: matrix: - - compiler: MinGW-w64 + - compiler: mingw bits: 32 - prefix_dir: C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32 - - compiler: MinGW-w64 + - compiler: mingw bits: 64 - prefix_dir: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64 - - compiler: MSVC15 + - compiler: msvc15 bits: 32 - - compiler: MSVC15 + - compiler: msvc15 bits: 64 before_build: - appveyor DownloadFile http://openal-soft.org/openal-binaries/openal-soft-1.17.2-bin.zip - 7z x openal-soft-1.17.2-bin.zip - move openal-soft-1.17.2-bin src\external\openal - - if [%COMPILER%]==[MinGW-w64] set CFLAGS=-m%BITS% & set LDFLAGS=-m%BITS% & set GENERATOR="MinGW Makefiles" - - if [%COMPILER%]==[MSVC15] if [%BITS%]==[32] set GENERATOR="Visual Studio 14 2015" - - if [%COMPILER%]==[MSVC15] if [%BITS%]==[64] set GENERATOR="Visual Studio 14 2015 Win64" - - set VERBOSE=1 + - if [%compiler%]==[mingw] set CFLAGS=-m%BITS% & set LDFLAGS=-m%BITS% & set GENERATOR="MinGW Makefiles" + - if [%COMPILER%]==[msvc15] if [%BITS%]==[32] set GENERATOR="Visual Studio 14 2015" + - if [%COMPILER%]==[msvc15] if [%BITS%]==[64] set GENERATOR="Visual Studio 14 2015 Win64" - mkdir build - cd build @@ -41,25 +42,26 @@ build_script: - cmake --build . --target install after_build: -# - cmake --build . --target package + - cmake --build . --target package before_test: test_script: -#artifacts: -# - path: 'build\*.zip' -# -#deploy: -# description: 'Automatic build by CI' -# provider: GitHub -# auth_token: -# secure: XXX -# artifact: /.*\.zip/ -# draft: false -# prerelease: false -# force_update: true -# on: -# branch: master -# appveyor_repo_tag: true # deploy on tag push only -# +artifacts: + - path: 'build\*.zip' + +deploy: + description: 'Automatic build by CI' + provider: GitHub + auth_token: + secure: lqkfPGZPK828Mmopbicrng08QaaQXAshp0a9E3bMXt8+hpA8vCfDAT3jgU8kaSsW + artifact: /.*\.zip/ + draft: false + prerelease: false + force_update: true + on: + branch: + - master + - develop + appveyor_repo_tag: true # deploy on tag push only diff --git a/raylib.pc.in b/raylib.pc.in index 0472c283..93984363 100644 --- a/raylib.pc.in +++ b/raylib.pc.in @@ -5,7 +5,7 @@ includedir=${prefix}/include Name: raylib Description: Simple and easy-to-use library to learn videogames programming -URL: https://github.com/raysan5/raylib +URL: http://github.com/raysan5/raylib Version: @PROJECT_VERSION@ Libs: -L${libdir} -lraylib Libs.private:@PKG_CONFIG_LIBS_PRIVATE@ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b29c29fc..1fec104f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,8 +2,7 @@ project(raylib) include("../utils.cmake") -set(raylib_VERSION_MAJOR 1) -set(raylib_VERSION_MINOR 8) +set(PROJECT_VERSION 1.9.0dev) set(RAYLIB raylib) # Name of the generated library @@ -173,3 +172,16 @@ message(STATUS "Compiling with the flags:") message(STATUS " PLATFORM=" ${PLATFORM}) message(STATUS " GRAPHICS=" ${GRAPHICS}) +# Packaging +SET(CPACK_PACKAGE_NAME "raylib") +SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Simple and easy-to-use library to learn videogames programming") +SET(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}") +SET(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}") +SET(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}") +SET(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}") +SET(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/../README.md") +SET(CPACK_RESOURCE_FILE_WELCOME "${PROJECT_SOURCE_DIR}/../README.md") +SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/../LICENSE.md") +SET(CPACK_PACKAGE_FILE_NAME "raylib-${PROJECT_VERSION}$ENV{RAYLIB_PACKAGE_SUFFIX}") +SET(CPACK_GENERATOR "ZIP;TGZ") # Remove this, if you want the NSIS installer on Windows +include(CPack) -- cgit v1.2.3 From 13fa61f7d9a4be326812a77a4148472961415776 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Fri, 24 Nov 2017 22:46:23 +0100 Subject: CI: Only push binaries for develop branch builds ... for now. Syntax was confusing Travis CI, AppVeyor is reporting 401, so lets see if this change at least fixes Travis. If this doesn't work, it might be that @raysan5's token is required. --- .travis.yml | 4 +--- appveyor.yml | 23 ++++++++++------------- 2 files changed, 11 insertions(+), 16 deletions(-) (limited to 'appveyor.yml') diff --git a/.travis.yml b/.travis.yml index 40817fba..d7124970 100644 --- a/.travis.yml +++ b/.travis.yml @@ -54,6 +54,4 @@ deploy: skip_cleanup: true on: repo: raysan5/raylib - branch: - - develop - - master + branch: develop diff --git a/appveyor.yml b/appveyor.yml index 2363bd3f..bfda4ec3 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -52,16 +52,13 @@ artifacts: - path: 'build\*.zip' deploy: - description: 'Automatic build by CI' - provider: GitHub - auth_token: - secure: lqkfPGZPK828Mmopbicrng08QaaQXAshp0a9E3bMXt8+hpA8vCfDAT3jgU8kaSsW - artifact: /.*\.zip/ - draft: false - prerelease: false - force_update: true - on: - branch: - - master - - develop - appveyor_repo_tag: true # deploy on tag push only + - provider: GitHub + auth_token: + secure: lqkfPGZPK828Mmopbicrng08QaaQXAshp0a9E3bMXt8+hpA8vCfDAT3jgU8kaSsW + artifact: /.*\.zip/ + draft: false + prerelease: false + force_update: true + on: + branch: develop + appveyor_repo_tag: true # deploy on tag push only -- cgit v1.2.3 From 853cc6f4c96f4de94a11aa8317e98fd0e42c64fd Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 25 Nov 2017 19:40:05 +0100 Subject: Added authorization token --- appveyor.yml | 2 +- src/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'appveyor.yml') diff --git a/appveyor.yml b/appveyor.yml index bfda4ec3..bee59fa5 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -54,7 +54,7 @@ artifacts: deploy: - provider: GitHub auth_token: - secure: lqkfPGZPK828Mmopbicrng08QaaQXAshp0a9E3bMXt8+hpA8vCfDAT3jgU8kaSsW + secure: OxKnnT3tlkPl9365cOO84rDWU4UkHIYJc0D3r3Tv7rB3HaR2BBhlhCnl7g3nuOJy artifact: /.*\.zip/ draft: false prerelease: false diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1fec104f..47938030 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,7 +2,7 @@ project(raylib) include("../utils.cmake") -set(PROJECT_VERSION 1.9.0dev) +set(PROJECT_VERSION 1.9.1-dev) set(RAYLIB raylib) # Name of the generated library -- cgit v1.2.3 From de78fa69bc49afa83898e33e73b6dfbffc43f0e4 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Wed, 6 Dec 2017 22:18:14 +0100 Subject: Fix CI builds after mini_al changes --- .travis.yml | 2 +- appveyor.yml | 3 --- src/CMakeLists.txt | 3 +-- src/external/mini_al.h | 4 +++- utils.cmake | 1 - 5 files changed, 5 insertions(+), 8 deletions(-) (limited to 'appveyor.yml') diff --git a/.travis.yml b/.travis.yml index 28641b38..7d1ffef0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,7 +23,7 @@ before_script: before_install: - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -y gcc-multilib - libopenal-dev + libasound2-dev libxcursor-dev libxinerama-dev mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev libglew-dev; diff --git a/appveyor.yml b/appveyor.yml index bee59fa5..a8572d07 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -28,9 +28,6 @@ environment: bits: 64 before_build: - - appveyor DownloadFile http://openal-soft.org/openal-binaries/openal-soft-1.17.2-bin.zip - - 7z x openal-soft-1.17.2-bin.zip - - move openal-soft-1.17.2-bin src\external\openal - if [%compiler%]==[mingw] set CFLAGS=-m%BITS% & set LDFLAGS=-m%BITS% & set GENERATOR="MinGW Makefiles" - if [%COMPILER%]==[msvc15] if [%BITS%]==[32] set GENERATOR="Visual Studio 14 2015" - if [%COMPILER%]==[msvc15] if [%BITS%]==[64] set GENERATOR="Visual Studio 14 2015 Win64" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 819dd1a4..200ae6f9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -83,8 +83,7 @@ endif() # Get the sources together file(GLOB raylib_sources *.c) file(GLOB stb_vorbis external/stb_vorbis.c) -file(GLOB mini_al external/mini_al.c) -set(sources ${raylib_sources} ${stb_vorbis}) +file(GLOB mini_al external/mini_al.c ${stb_vorbis}) set(sources ${raylib_sources} ${mini_al}) # Which platform? diff --git a/src/external/mini_al.h b/src/external/mini_al.h index 7d83b548..36c394ad 100644 --- a/src/external/mini_al.h +++ b/src/external/mini_al.h @@ -2745,12 +2745,14 @@ static mal_result mal_context__try_get_device_name_by_id(mal_context* pContext, } } break; #endif + #if 0 #ifdef MAL_HAS_COREAUDIO - case mal_backend_coreaudio + case mal_backend_coreaudio: { // TODO: Implement me. } break; #endif + #endif #ifdef MAL_HAS_OSS case mal_backend_oss: { diff --git a/utils.cmake b/utils.cmake index 43b479da..d2c82cd1 100644 --- a/utils.cmake +++ b/utils.cmake @@ -23,7 +23,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL Linux) # Elsewhere (such as Linux), need `-lopenal -lGL`, etc... set(LIBS_PRIVATE m pthread dl - openal GL X11 Xrandr Xinerama Xi Xxf86vm Xcursor) # X11 stuff endif() -- cgit v1.2.3 From 263e81b5c92a575b35e44a33b4b5f833489073a0 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Thu, 14 Dec 2017 12:20:05 +0100 Subject: Build shared libs, games and examples on CI Now with external OpenAL and GLFW dependencies removed, we don't have to worry about installing them in CI. Shared libraries are now always built along with static libs. Games and examples are built everwhere except for Visual Studio, because Physac needs pthreads, which VS doesn't provide. --- .travis.yml | 18 +++++++++--------- appveyor.yml | 6 +++++- 2 files changed, 14 insertions(+), 10 deletions(-) (limited to 'appveyor.yml') diff --git a/.travis.yml b/.travis.yml index 7d1ffef0..62278cd4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,26 +7,26 @@ git: # TODO we could use a 32 bit Docker container for running true 32-bit tests # services: - docker -matrix: # We don't install x11 32-bit libraries, so skip shared libraries on -m32 +matrix: include: - os: linux - env: ARCH=i386 SHARED=OFF EXAMPLES=OFF + env: ARCH=i386 sudo: required - os: linux - env: ARCH=amd64 SHARED=ON EXAMPLES=ON + env: ARCH=amd64 sudo: required - os: osx - env: ARCH=amd64 SHARED=ON EXAMPLES=ON + env: ARCH=amd64 before_script: before_install: - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -y gcc-multilib - libasound2-dev - libxcursor-dev libxinerama-dev - mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev - libgl1-mesa-dev libglu1-mesa-dev libglew-dev; + libasound2-dev:$ARCH + libxcursor-dev:$ARCH libxinerama-dev:$ARCH mesa-common-dev:$ARCH + libx11-dev:$ARCH libxrandr-dev:$ARCH libxi-dev:$ARCH + libgl1-mesa-dev:$ARCH libglu1-mesa-dev:$ARCH libglew-dev:$ARCH; export RAYLIB_PACKAGE_SUFFIX="-Linux-$ARCH"; if [ "$ARCH" == "i386" ]; then export CFLAGS="-m32"; fi; if [ "$ARCH" == "amd64" ]; then export CFLAGS="-m64"; fi; @@ -37,7 +37,7 @@ before_install: script: - mkdir build - cd build - - cmake -DMACOS_FATLIB=ON -DSTATIC_RAYLIB=ON -DSHARED_RAYLIB=$SHARED -DBUILD_EXAMPLES=$EXAMPLES -DBUILD_GAMES=$EXAMPLES .. + - cmake -DMACOS_FATLIB=ON -DSTATIC_RAYLIB=ON -DSHARED_RAYLIB=ON -DBUILD_EXAMPLES=ON -DBUILD_GAMES=ON .. - make VERBOSE=1 - make package diff --git a/appveyor.yml b/appveyor.yml index a8572d07..4148e744 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -20,12 +20,16 @@ environment: matrix: - compiler: mingw bits: 32 + examples: ON - compiler: mingw bits: 64 + examples: ON - compiler: msvc15 bits: 32 + examples: OFF - compiler: msvc15 bits: 64 + examples: OFF before_build: - if [%compiler%]==[mingw] set CFLAGS=-m%BITS% & set LDFLAGS=-m%BITS% & set GENERATOR="MinGW Makefiles" @@ -35,7 +39,7 @@ before_build: - cd build build_script: - - cmake -G %GENERATOR% -DSTATIC_RAYLIB=ON -DSHARED_RAYLIB=OFF -DBUILD_EXAMPLES=OFF -DBUILD_GAMES=OFF .. + - cmake -G %GENERATOR% -DSTATIC_RAYLIB=ON -DSHARED_RAYLIB=ON -DBUILD_EXAMPLES=%examples% -DBUILD_GAMES=%examples% .. - cmake --build . --target install after_build: -- cgit v1.2.3 From 051040af2d0829933f474e1accf8441b352bed13 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Fri, 16 Feb 2018 05:43:13 +0100 Subject: CMake: Remove _RAYLIB suffix from -D{SHARED,STATIC}_RAYLIB They were named so for compatibility with make, but make doesn't use the anymore. I always forget whether it's SHARED_RAYLIB or RAYLIB_SHARED... For now, RAYLIB_SHARED and STATIC_RAYLIB may still be used, but print a deprecation warning. --- .travis.yml | 2 +- appveyor.yml | 2 +- src/CMakeLists.txt | 27 ++++++++++++++++++--------- 3 files changed, 20 insertions(+), 11 deletions(-) (limited to 'appveyor.yml') diff --git a/.travis.yml b/.travis.yml index e3a0e67d..19241346 100644 --- a/.travis.yml +++ b/.travis.yml @@ -45,7 +45,7 @@ before_install: script: - mkdir build - cd build - - cmake -DMACOS_FATLIB=ON -DSTATIC_RAYLIB=ON -DSHARED_RAYLIB=ON -DBUILD_EXAMPLES=ON -DBUILD_GAMES=ON -DUSE_EXTERNAL_GLFW=IF_POSSIBLE .. + - cmake -DMACOS_FATLIB=ON -DSTATIC=ON -DSHARED=ON -DBUILD_EXAMPLES=ON -DBUILD_GAMES=ON -DUSE_EXTERNAL_GLFW=IF_POSSIBLE .. - make VERBOSE=1 - make package diff --git a/appveyor.yml b/appveyor.yml index 4148e744..bec37da8 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -39,7 +39,7 @@ before_build: - cd build build_script: - - cmake -G %GENERATOR% -DSTATIC_RAYLIB=ON -DSHARED_RAYLIB=ON -DBUILD_EXAMPLES=%examples% -DBUILD_GAMES=%examples% .. + - cmake -G %GENERATOR% -DSTATIC=ON -DSHARED=ON -DBUILD_EXAMPLES=%examples% -DBUILD_GAMES=%examples% .. - cmake --build . --target install after_build: diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 40871455..6f759324 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -10,12 +10,21 @@ set(RAYLIB raylib) # Name of the generated library # Shared library is always PIC. Static library should be PIC too if linked into a shared library set(WITH_PIC OFF CACHE BOOL "Compile static library as position-independent code" OFF) # Build a static and/or shared raylib? -set(SHARED_RAYLIB OFF CACHE BOOL "Build raylib as a dynamic library") -set(STATIC_RAYLIB ON CACHE BOOL "Build raylib as a static library") +set(SHARED OFF CACHE BOOL "Build raylib as a dynamic library") +set(STATIC ON CACHE BOOL "Build raylib as a static library") set(MACOS_FATLIB ON CACHE BOOL "Build fat library for both i386 and x86_64 on macOS") -if(NOT (STATIC_RAYLIB OR SHARED_RAYLIB)) - message(FATAL_ERROR "Nothing to do if both -DSHARED_RAYLIB=OFF and -DSTATIC_RAYLIB=OFF...") +if(NOT (STATIC OR SHARED)) + message(FATAL_ERROR "Nothing to do if both -DSHARED=OFF and -DSTATIC=OFF...") +endif() + +if(DEFINED SHARED_RAYLIB) + set(SHARED ${SHARED_RAYLIB}) + message(DEPRECATION "-DSHARED_RAYLIB is deprecated. Please use -DSHARED instead.") +endif() +if(DEFINED STATIC_RAYLIB) + set(STATIC ${STATIC_RAYLIB}) + message(DEPRECATION "-DSTATIC_RAYLIB is deprecated. Please use -DSTATIC instead.") endif() # Platform @@ -85,7 +94,7 @@ endif() if(MACOS_FATLIB) if (CMAKE_OSX_ARCHITECTURES) - message(FATAL_ERROR "User supplied -DCMAKE_OSX_ARCHITECTURES overrides BUILD_MACOS_FATLIB=ON") + message(FATAL_ERROR "User supplied -DCMAKE_OSX_ARCHITECTURES overrides -DMACOS_FATLIB=ON") else() SET(CMAKE_OSX_ARCHITECTURES "x86_64;i386") endif() @@ -94,7 +103,7 @@ endif() # Which platform? if(${PLATFORM} MATCHES "PLATFORM_DESKTOP") - if(${SHARED_RAYLIB}) + if(${SHARED}) add_library(${RAYLIB}_shared SHARED ${sources}) target_compile_definitions(${RAYLIB}_shared @@ -127,9 +136,9 @@ if(${PLATFORM} MATCHES "PLATFORM_DESKTOP") PUBLIC_HEADER DESTINATION include ) endif() - endif(${SHARED_RAYLIB}) + endif(${SHARED}) - if(${STATIC_RAYLIB}) + if(${STATIC}) add_library(${RAYLIB} STATIC ${sources}) target_compile_definitions(${RAYLIB} @@ -147,7 +156,7 @@ if(${PLATFORM} MATCHES "PLATFORM_DESKTOP") ARCHIVE DESTINATION lib PUBLIC_HEADER DESTINATION include ) - endif(${STATIC_RAYLIB}) + endif(${STATIC}) configure_file(../raylib.pc.in raylib.pc @ONLY) install(FILES ${CMAKE_BINARY_DIR}/release/raylib.pc DESTINATION lib/pkgconfig) -- cgit v1.2.3 From d892243d18aaae5b2c425cd8a504775f105413fe Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Mon, 19 Feb 2018 13:56:55 +0100 Subject: CI: Build artifacts for master, not develop tags See #443 for more information. --- .travis.yml | 2 +- appveyor.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'appveyor.yml') diff --git a/.travis.yml b/.travis.yml index 19241346..5037a717 100644 --- a/.travis.yml +++ b/.travis.yml @@ -58,5 +58,5 @@ deploy: skip_cleanup: true on: repo: raysan5/raylib - branch: develop + branch: master tags: true diff --git a/appveyor.yml b/appveyor.yml index bec37da8..6452a089 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -61,5 +61,5 @@ deploy: prerelease: false force_update: true on: - branch: develop + branch: master appveyor_repo_tag: true # deploy on tag push only -- cgit v1.2.3