diff --git a/.travis.yml b/.travis.yml index fe17c41..dbd34cc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,41 @@ language: cpp +sudo: required +os: linux dist: trusty +branches: + only: + - master + compiler: - clang - gcc -install: - - curl https://vulkan.lunarg.com/sdk/home#sdk/downloadConfirm/1.0.57.0/linux/vulkansdk-linux-x86_64-1.0.57.0.run - - ./vulkansdk-linux-x86_64-1.0.57.0.run +before_script: + sudo apt-get -qq update + sudo apt-get install -y libassimp-dev libx11-xcb-dev libxrandr-dev -script: echo "Foo" +install: + - wget https://github.com/premake/premake-core/releases/download/v5.0.0-alpha11/premake-5.0.0-alpha11-linux.tar.gz + - tar -xzvf premake-5.0.0-alpha11-linux.tar.gz + - sudo apt-get update + - sudo apt-get dist-upgrade + - sudo apt-get install libglm-dev graphviz libxcb-dri3-0 libxcb-present0 libpciaccess0 cmake libpng-dev libxcb-dri3-dev libx11-dev libmirclient-dev libwayland-dev libxrandr-dev + - wget -O vulkansdk-linux-x86_64-1.0.51.0.run https://vulkan.lunarg.com/sdk/download/1.0.51.0/linux/vulkansdk-linux-x86_64-1.0.51.0.run + - chmod ugo+x vulkansdk-linux-x86_64-1.0.51.0.run + - ./vulkansdk-linux-x86_64-1.0.51.0.run + - export VULKAN_SDK=$TRAVIS_BUILD_DIR/VulkanSDK/1.0.51.0/x86_64 + +script: + - cd premake + - ../premake5 gmake + - cd ../build + - make config=debug_linux-x64 + - cd .. + +notifications: + email: + recipients: + - adam.sawicki@amd.com + on_success: change + on_failure: always diff --git a/premake/premake5.lua b/premake/premake5.lua index d77ccc9..1f2c550 100644 --- a/premake/premake5.lua +++ b/premake/premake5.lua @@ -1,20 +1,26 @@ -- _ACTION is a premake global variable and for our usage will be vs2012, vs2013, etc. -- Strip "vs" from this string to make a suffix for solution and project files. -_SUFFIX = string.gsub(_ACTION, "vs", "") +_SUFFIX = _ACTION workspace "VulkanSample" configurations { "Debug", "Release" } -platforms { "x64" } +platforms { "Windows-x64", "Linux-x64" } location "../build" filename ("VulkanSample_" .. _SUFFIX) startproject "VulkanSample" -filter "platforms:x64" +filter "platforms:Windows-x64" system "Windows" architecture "x64" includedirs { "../third_party/mathfu-1.1.0/include", "$(VULKAN_SDK)/Include" } libdirs { "$(VULKAN_SDK)/Lib" } +filter "platforms:Linux-x64" +system "Linux" +architecture "x64" +includedirs { "$(VULKAN_SDK)/include" } +libdirs { "$(VULKAN_SDK)/lib" } + project "VulkanSample" kind "ConsoleApp" language "C++" @@ -24,20 +30,31 @@ targetdir "../bin" objdir "../build/Desktop_%{_SUFFIX}/%{cfg.platform}/%{cfg.buildcfg}" floatingpoint "Fast" files { "../src/*.h", "../src/*.cpp" } -links { "vulkan-1" } flags { "NoPCH", "FatalWarnings" } characterset "Unicode" -defines { "WIN32", "_CONSOLE", "PROFILE", "_WINDOWS", "_WIN32_WINNT=0x0601" } filter "configurations:Debug" defines { "_DEBUG", "DEBUG" } flags { } targetsuffix ("_Debug_" .. _SUFFIX) -buildoptions { "/MDd" } filter "configurations:Release" defines { "NDEBUG" } optimize "On" flags { "LinkTimeOptimization" } targetsuffix ("_Release_" .. _SUFFIX) + +filter { "platforms:Windows-x64" } +defines { "WIN32", "_CONSOLE", "PROFILE", "_WINDOWS", "_WIN32_WINNT=0x0601" } +links { "vulkan-1" } + +filter { "platforms:Linux-x64" } +buildoptions { "-std=c++0x" } +links { "vulkan" } + +filter { "configurations:Debug", "platforms:Windows-x64" } +buildoptions { "/MDd" } + +filter { "configurations:Release", "platforms:Windows-x64" } buildoptions { "/MD" } + diff --git a/src/VulkanSample.cpp b/src/VulkanSample.cpp index 99a7c07..f06f49f 100644 --- a/src/VulkanSample.cpp +++ b/src/VulkanSample.cpp @@ -20,6 +20,8 @@ // THE SOFTWARE. // +#ifdef WIN32 + #define NOMINMAX #define WIN32_LEAN_AND_MEAN #include @@ -1766,3 +1768,15 @@ int main() return 0; } + +#else // #ifdef WIN32 + +#define VMA_IMPLEMENTATION +#include "vk_mem_alloc.h" + +int main() +{ +} + +#endif // #ifdef WIN32 +