Skip to content

Commit

Permalink
Fix Android Studio build on Windows host
Browse files Browse the repository at this point in the history
  • Loading branch information
ruslo committed Aug 15, 2018
1 parent c4ae9c8 commit b4f1ae5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/examples/cmake/include/init.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ set(top_dir "${CMAKE_CURRENT_LIST_DIR}/../..")

if(FACEFILTER_ANDROID_STUDIO)
set(gen_toolchain "${CMAKE_CURRENT_BINARY_DIR}/generated/toolchain.cmake")
file(TO_CMAKE_PATH "${CMAKE_TOOLCHAIN_FILE}" CMAKE_TOOLCHAIN_FILE_CMAKE_PATH)
configure_file(
"${top_dir}/cmake/template/toolchain.cmake.in"
"${gen_toolchain}"
Expand Down
12 changes: 6 additions & 6 deletions src/examples/cmake/template/toolchain.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,18 @@ set(CMAKE_SYSTEM_VERSION "@CMAKE_SYSTEM_VERSION@")

if("@_INTERNAL_ANDROID_STUDIO_ORIGINAL_CMAKE_TOOLCHAIN_FILE@" STREQUAL "")
# Variable not set, initial project configuration.
# Path to original Android NDK toolchain saved in CMAKE_TOOLCHAIN_FILE.
if("@CMAKE_TOOLCHAIN_FILE@" STREQUAL "")
message(FATAL_ERROR "Unexpected: CMAKE_TOOLCHAIN_FILE is empty")
# Path to original Android NDK toolchain saved in CMAKE_TOOLCHAIN_FILE_CMAKE_PATH.
if("@CMAKE_TOOLCHAIN_FILE_CMAKE_PATH@" STREQUAL "")
message(FATAL_ERROR "Unexpected: CMAKE_TOOLCHAIN_FILE_CMAKE_PATH is empty")
endif()

if(NOT EXISTS "@CMAKE_TOOLCHAIN_FILE@")
if(NOT EXISTS "@CMAKE_TOOLCHAIN_FILE_CMAKE_PATH@")
message(
FATAL_ERROR "CMAKE_TOOLCHAIN_FILE not found: '@CMAKE_TOOLCHAIN_FILE@'"
FATAL_ERROR "File not found: '@CMAKE_TOOLCHAIN_FILE_CMAKE_PATH@'"
)
endif()

set(_original_toolchain_file "@CMAKE_TOOLCHAIN_FILE@")
set(_original_toolchain_file "@CMAKE_TOOLCHAIN_FILE_CMAKE_PATH@")
else()
set(_original_toolchain_file "@_INTERNAL_ANDROID_STUDIO_ORIGINAL_CMAKE_TOOLCHAIN_FILE@")
endif()
Expand Down

0 comments on commit b4f1ae5

Please sign in to comment.