Fix cmake configure on windows
This commit is contained in:
parent
f6b895c796
commit
211995a604
3 changed files with 48 additions and 60 deletions
|
@ -14,20 +14,6 @@ include(${CMAKE_CURRENT_LIST_DIR}/cmake/Common.cmake)
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/cmake/AddPlatformExecutable.cmake)
|
include(${CMAKE_CURRENT_LIST_DIR}/cmake/AddPlatformExecutable.cmake)
|
||||||
include(FetchContent)
|
include(FetchContent)
|
||||||
|
|
||||||
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
|
||||||
message("Windows build detected!")
|
|
||||||
|
|
||||||
set(ENABLE_WINDOWS ON)
|
|
||||||
set(ENABLE_VULKAN ON)
|
|
||||||
set(ENABLE_OPENGL ON)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(${CMAKE_SYSTEM_NAME} STREQUAL "WindowsStore")
|
|
||||||
message("UWP build detected!")
|
|
||||||
|
|
||||||
set(ENABLE_UWP TRUE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" AND NOT IOS)
|
if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" AND NOT IOS)
|
||||||
message("macOS build detected!")
|
message("macOS build detected!")
|
||||||
|
|
||||||
|
@ -116,6 +102,53 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "tvOS")
|
||||||
manual_download()
|
manual_download()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
||||||
|
message("Windows build detected!")
|
||||||
|
|
||||||
|
set(ENABLE_WINDOWS ON)
|
||||||
|
set(ENABLE_VULKAN ON)
|
||||||
|
|
||||||
|
manual_download()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(${CMAKE_SYSTEM_NAME} STREQUAL "WindowsStore")
|
||||||
|
message("UWP build detected!")
|
||||||
|
|
||||||
|
set(ENABLE_UWP TRUE)
|
||||||
|
|
||||||
|
manual_download()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT ENABLE_IOS AND NOT ENABLE_TVOS AND NOT ENABLE_WINDOWS)
|
||||||
|
find_package(spirv_cross_core REQUIRED)
|
||||||
|
find_package(spirv_cross_glsl REQUIRED)
|
||||||
|
find_package(spirv_cross_cpp REQUIRED)
|
||||||
|
find_package(spirv_cross_msl REQUIRED)
|
||||||
|
find_package(glslang REQUIRED)
|
||||||
|
|
||||||
|
set(CROSS_LIBS
|
||||||
|
glslang::glslang
|
||||||
|
glslang::SPIRV
|
||||||
|
glslang::OSDependent
|
||||||
|
glslang::OGLCompiler
|
||||||
|
glslang::HLSL
|
||||||
|
spirv-cross-core
|
||||||
|
spirv-cross-glsl
|
||||||
|
spirv-cross-cpp
|
||||||
|
spirv-cross-msl
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
set(CROSS_LIBS
|
||||||
|
spirv-cross-core
|
||||||
|
spirv-cross-glsl
|
||||||
|
spirv-cross-cpp
|
||||||
|
spirv-cross-msl
|
||||||
|
glslang
|
||||||
|
SPIRV
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
add_subdirectory(extern)
|
add_subdirectory(extern)
|
||||||
add_subdirectory(platforms)
|
add_subdirectory(platforms)
|
||||||
|
|
||||||
|
|
|
@ -19,35 +19,6 @@ set(SRC
|
||||||
src/scenecapture.cpp
|
src/scenecapture.cpp
|
||||||
src/shadercompiler.cpp
|
src/shadercompiler.cpp
|
||||||
src/dofpass.cpp)
|
src/dofpass.cpp)
|
||||||
|
|
||||||
if(NOT ENABLE_IOS AND NOT ENABLE_TVOS)
|
|
||||||
find_package(spirv_cross_core REQUIRED)
|
|
||||||
find_package(spirv_cross_glsl REQUIRED)
|
|
||||||
find_package(spirv_cross_cpp REQUIRED)
|
|
||||||
find_package(spirv_cross_msl REQUIRED)
|
|
||||||
find_package(glslang REQUIRED)
|
|
||||||
|
|
||||||
set(CROSS_LIBS
|
|
||||||
glslang::glslang
|
|
||||||
glslang::SPIRV
|
|
||||||
glslang::OSDependent
|
|
||||||
glslang::OGLCompiler
|
|
||||||
glslang::HLSL
|
|
||||||
spirv-cross-core
|
|
||||||
spirv-cross-glsl
|
|
||||||
spirv-cross-cpp
|
|
||||||
spirv-cross-msl
|
|
||||||
)
|
|
||||||
else()
|
|
||||||
set(CROSS_LIBS
|
|
||||||
spirv-cross-core
|
|
||||||
spirv-cross-glsl
|
|
||||||
spirv-cross-cpp
|
|
||||||
spirv-cross-msl
|
|
||||||
glslang
|
|
||||||
SPIRV
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_library(Renderer STATIC ${SRC})
|
add_library(Renderer STATIC ${SRC})
|
||||||
target_link_libraries(Renderer
|
target_link_libraries(Renderer
|
||||||
|
|
|
@ -1,23 +1,7 @@
|
||||||
set(CMAKE_TOOLCHAIN_FILE "")
|
|
||||||
|
|
||||||
find_package(spirv_cross_core REQUIRED)
|
|
||||||
find_package(spirv_cross_glsl REQUIRED)
|
|
||||||
find_package(spirv_cross_cpp REQUIRED)
|
|
||||||
find_package(spirv_cross_msl REQUIRED)
|
|
||||||
find_package(glslang REQUIRED)
|
|
||||||
|
|
||||||
add_executable(ShaderCompiler main.cpp)
|
add_executable(ShaderCompiler main.cpp)
|
||||||
target_link_libraries(ShaderCompiler
|
target_link_libraries(ShaderCompiler
|
||||||
PUBLIC
|
PUBLIC
|
||||||
glslang::glslang
|
${CROSS_LIBS}
|
||||||
glslang::SPIRV
|
|
||||||
glslang::OSDependent
|
|
||||||
glslang::OGLCompiler
|
|
||||||
glslang::HLSL
|
|
||||||
spirv-cross-core
|
|
||||||
spirv-cross-glsl
|
|
||||||
spirv-cross-cpp
|
|
||||||
spirv-cross-msl
|
|
||||||
Log)
|
Log)
|
||||||
set_engine_properties(ShaderCompiler)
|
set_engine_properties(ShaderCompiler)
|
||||||
set_output_dir(ShaderCompiler)
|
set_output_dir(ShaderCompiler)
|
||||||
|
|
Reference in a new issue