-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable compiles with clang-cl on windows
- Loading branch information
1 parent
70c0bb5
commit cce9484
Showing
8 changed files
with
64 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,19 @@ | ||
## Instructions | ||
1. <code>./toolchains/windows/cmake_configure.bat</code> | ||
2. <code>./toolchains/windows/build.bat</code> | ||
3. <code>./build-windows/\<program\></code> | ||
1. ```./toolchains/windows/cmake_configure.sh``` | ||
2. ```ninja -C build-windows``` | ||
3. ```./build-windows/\<program\>``` | ||
|
||
## Compiling with clang-cl | ||
Compiling with clang gives better performing binaries compared to MSVC cl. | ||
|
||
1. Setup x64 developer environment for C++ for MSVC. | ||
2. Make sure clang for C++ is installed through Visual Studio. | ||
3. Enter a bash shell. | ||
4. ```CC=clang CXX=clang++ ./toolchains/windows/cmake_configure.sh``` | ||
|
||
## Compiling with different SIMD flags | ||
The default windows build compiles with AVX2 instructions. If your CPU doesn't support these then you will have to modify the scripts. | ||
|
||
```vcpkg.json``` contains ```fftw3f``` which uses the ```avx2``` feature. Change this to ```[avx, sse2, sse]```. | ||
|
||
```CMakeLists.txt``` contains ```/arch:AVX2```. Change this to ```/arch:AVX``` or remove this compiler option. |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/sh | ||
if [[ -z "$VCPKG_ROOT" ]]; then | ||
TOOLCHAIN_FILE="C:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake" | ||
else | ||
TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" | ||
fi | ||
|
||
if [[ -z "$BUILD_OUT" ]]; then | ||
BUILD_OUT="build-windows" | ||
fi | ||
|
||
if [[ -z "$BUILD_TYPE" ]]; then | ||
BUILD_TYPE="Release" | ||
fi | ||
|
||
cmake .\ | ||
-B $BUILD_OUT\ | ||
-G Ninja\ | ||
-DCMAKE_BUILD_TYPE:STRING=$BUILD_TYPE\ | ||
-DCMAKE_TOOLCHAIN_FILE:STRING=$TOOLCHAIN_FILE\ | ||
-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE |