Skip to content
Permalink
Browse files

cmake: use Win32Deps when mingw cross compiling

So that dependencies submodule is cloned.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
  • Loading branch information
rkitover committed Apr 16, 2019
1 parent ffc9309 commit 8abbb070e898c5bd4b537e19de30094399eda7ea
Showing with 8 additions and 5 deletions.
  1. +1 −1 CMakeLists.txt
  2. +7 −4 cmake/Win32Deps.cmake
@@ -6,7 +6,7 @@ if(COMMAND cmake_policy)
cmake_policy(SET CMP0077 NEW) # use vars for options
endif()

if(NOT CMAKE_VERSION VERSION_LESS 3.0)
if(POLICY CMP0043)
cmake_policy(SET CMP0043 NEW) # for wxWidgets, use generator expressions
endif()
endif()
@@ -1,4 +1,4 @@
if(WIN32)
if(WIN32 OR CMAKE_TOOLCHAIN_FILE MATCHES "[Mm][Ii][Nn][Gg][Ww]")
# compiler has not been detected yet maybe
if(CMAKE_C_COMPILER MATCHES "cl\\.exe" OR CMAKE_CXX_COMPILER MATCHES "cl\\.exe" OR MSVC OR DEFINED ENV{VisualStudioVersion})
set(VS TRUE)
@@ -12,11 +12,14 @@ if(WIN32)
# Win32 deps submodules (dependencies and vcpkg)
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/dependencies/mingw-xaudio/include" OR NOT EXISTS "${CMAKE_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake")
set(git_checkout FALSE)
# find_package(Git)
#if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git")

if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
set(git_checkout TRUE)
execute_process(COMMAND git submodule update --init --remote --recursive RESULT_VARIABLE git_status WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
execute_process(
COMMAND git submodule update --init --remote --recursive
RESULT_VARIABLE git_status
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
)
endif()

if(NOT (git_checkout AND git_status EQUAL 0))

0 comments on commit 8abbb07

Please sign in to comment.
You can’t perform that action at this time.