From 4fa507a79c87b9e4b89ec66e23b230e981bb4326 Mon Sep 17 00:00:00 2001 From: Jeremy Hayes Date: Sun, 9 Oct 2016 13:57:43 -0600 Subject: [PATCH] demos: fix cubepp cross-platform build Change-Id: I823154dc0c61e7358d88fe6afc4f5808b640804d --- demos/CMakeLists.txt | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/demos/CMakeLists.txt b/demos/CMakeLists.txt index 837d32d..c19c044 100644 --- a/demos/CMakeLists.txt +++ b/demos/CMakeLists.txt @@ -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) -- 2.7.4