Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix compilation on Linux #17

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions samples/01_window/src/01_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifdef _MSC_VER
// Windows #defines MemoryBarrier which collides with vk::MemoryBarrier
// #undef here...
#include <Windows.h>
#if defined(MemoryBarrier)
# undef MemoryBarrier
#endif
#endif

#define GLFW_INCLUDE_VULKAN
#include <GLFW/glfw3.h>
Expand Down
8 changes: 1 addition & 7 deletions samples/02_triangle/src/02_triangle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#define VK_USE_PLATFORM_WIN32_KHR
#include <Windows.h>
#if defined(MemoryBarrier)
# undef MemoryBarrier
#endif
#include <VkHLFSampleWindow.h>

#define GLFW_INCLUDE_VULKAN
#include <GLFW/glfw3.h>
Expand All @@ -40,8 +36,6 @@
#include <system_error>
#include <vector>

#include <VkHLFSampleWindow.h>

#define FENCE_TIMEOUT 100000000

class Window : public VkHLFSampleWindow
Expand Down
2 changes: 2 additions & 0 deletions samples/VkHLFSampleUtils/VkHLFSampleWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifdef _MSC_VER
// Windows #defines MemoryBarrier which collides with vk::MemoryBarrier
// #undef here...
#include <Windows.h>
#if defined(MemoryBarrier)
# undef MemoryBarrier
#endif
#endif

#define GLFW_INCLUDE_VULKAN
#include <GLFW/glfw3.h>
Expand Down
9 changes: 1 addition & 8 deletions samples/VkHLFSampleUtils/src/VkHLFSampleWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

// Windows #defines MemoryBarrier which collides with vk::MemoryBarrier
// #undef here...
#include <Windows.h>
#if defined(MemoryBarrier)
# undef MemoryBarrier
#endif
#include <VkHLFSampleWindow.h>

#define GLFW_INCLUDE_VULKAN
#include <GLFW/glfw3.h>
Expand All @@ -43,8 +38,6 @@
#include <system_error>
#include <vector>

#include <VkHLFSampleWindow.h>

VkHLFSampleWindow::VkHLFSampleWindow(char const * title, int width, int height)
: m_window(nullptr, glfwDestroyWindow)
{
Expand Down
7 changes: 6 additions & 1 deletion vkhlf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,15 @@ target_include_directories(VkHLF

target_link_libraries( VkHLF
${OPENGL_gl_LIBRARY}
"$ENV{VK_SDK_PATH}/Lib/vulkan-1.lib"
glslang
OGLCompiler
OSDependent
HLSL
SPIRV
)

if(UNIX)
target_link_libraries(VkHLF vulkan)
else()
target_link_libraries(VkHLF "$ENV{VK_SDK_PATH}/Lib/vulkan-1.lib")
endif()