demos: fix cubepp cross-platform build
authorJeremy Hayes <jeremy@lunarg.com>
Sun, 9 Oct 2016 19:57:43 +0000 (13:57 -0600)
committerJeremy Hayes <jeremy@lunarg.com>
Sun, 9 Oct 2016 20:33:56 +0000 (14:33 -0600)
Change-Id: I823154dc0c61e7358d88fe6afc4f5808b640804d

demos/CMakeLists.txt

index 837d32d..c19c044 100644 (file)
@@ -111,12 +111,21 @@ else()
     target_link_libraries(cube ${LIBRARIES})
 endif()
 
-if(UNIX)
-    add_executable(cubepp cube.cpp ${CMAKE_BINARY_DIR}/demos/cube-vert.spv ${CMAKE_BINARY_DIR}/demos/cube-frag.spv)
-elseif(WIN32)
+if(NOT WIN32)
+    if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL ${CMAKE_HOST_SYSTEM_PROCESSOR})
+        add_executable(cubepp cube.cpp ${CMAKE_BINARY_DIR}/demos/cube-vert.spv ${CMAKE_BINARY_DIR}/demos/cube-frag.spv)
+        target_link_libraries(cubepp ${LIBRARIES})
+    endif()
+else()
+    if (CMAKE_CL_64)
+        set (LIB_DIR "Win64")
+    else()
+        set (LIB_DIR "Win32")
+    endif()
+
     add_executable(cubepp WIN32 cube.cpp ${CMAKE_BINARY_DIR}/demos/cube-vert.spv ${CMAKE_BINARY_DIR}/demos/cube-frag.spv)
+    target_link_libraries(cubepp ${LIBRARIES})
 endif()
-target_link_libraries(cubepp ${LIBRARIES})
 
 if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL ${CMAKE_HOST_SYSTEM_PROCESSOR})
     add_subdirectory(smoke)