OSDN Git Service

Disable LLVM_ENABLE_THREADS in config generation script
[android-x86/external-swiftshader.git] / build / cmake.sh
1 #!/bin/bash\r
2 \r
3 # This shell script is for (re)generating Visual Studio project files from CMake\r
4 # files, making them path relative so they can be checked into the repository.\r
5 \r
6 # exit when any command fails\r
7 set -e\r
8 \r
9 if [[ "$OSTYPE" != "msys" ]]; then\r
10     echo This script is meant for generation of path relative Visual Studio project\r
11     echo files from CMake. It should be run from an MSYS/MinGW bash shell, such as\r
12     echo the one that comes with Git for Windows.\r
13     exit 1\r
14 fi\r
15 \r
16 CMAKE_GENERATOR="Visual Studio 15 2017 Win64"\r
17 \r
18 CMAKE_BUILD_PATH="build/$CMAKE_GENERATOR"\r
19 \r
20 if [ ! -d "$CMAKE_BUILD_PATH" ]; then\r
21     mkdir -p "$CMAKE_BUILD_PATH"\r
22 fi\r
23 cd "$CMAKE_BUILD_PATH"\r
24 \r
25 cmake -G"$CMAKE_GENERATOR" \\r
26       -Thost=x64 \\r
27       -DSPIRV-Headers_SOURCE_DIR="${CMAKE_HOME_DIRECTORY}/third_party/SPIRV-Headers" \\r
28       -DCMAKE_CONFIGURATION_TYPES="Debug;Release" \\r
29       -DSKIP_SPIRV_TOOLS_INSTALL=true \\r
30       -DSPIRV_SKIP_EXECUTABLES=true \\r
31       -DSPIRV_SKIP_TESTS=true \\r
32       ../..\r
33 \r
34 cd ../..\r
35 \r
36 echo Making project files path relative. This might take a minute.\r
37 \r
38 # Current directory with forward slashes\r
39 CD=$(pwd -W)/\r
40 # Current directory with (escaped) backslashes\r
41 CD2=$(echo $(pwd -W) | sed 's?/?\\\\?g')\\\\\r
42 # Phython executable path\r
43 PYTHON=$(where python | head --lines=1 | sed 's?\\?\\\\?g')\r
44 # CMake executable path\r
45 CMAKE=$(where cmake | head --lines=1 | sed 's?\\?\\\\?g')\r
46 \r
47 find . -type f \( -name \*.vcxproj -o -name \*.vcxproj.filters -o -name \*.sln \) \\r
48      -execdir sed --in-place --binary --expression="s?$CD?\$(SolutionDir)?g" {} \\r
49                                       --expression="s?$CD2?\$(SolutionDir)?g" {} \\r
50                                       --expression="s?$PYTHON?python?g" {} \\r
51                                       --expression="s?$CMAKE?cmake?g" {} \\r
52                                       --expression="s?MultiThreadedDebugDLL?MultiThreadedDebug?g" {} \\r
53                                       --expression="s?MultiThreadedDLL?MultiThreaded?g" {} \;