Repository navigation
Add CMake script - #492
Add CMake script#492
Conversation
|
If you are interested in setting up AppVeyor CI to test Windows builds, an example config could be: version: {build}
environment:
matrix:
- GENERATOR: MinGW Makefiles
- GENERATOR: Visual Studio 14 2015
- GENERATOR: Visual Studio 14 2015 Win64
configuration: Debug
before_build:
# Workaround for CMake not wanting sh.exe on PATH for MinGW
- set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
- set PATH=C:\MinGW\bin;%PATH%
- mkdir build
- cd build
- cmake -DCMAKE_BUILD_TYPE=%CONFIGURATION% -G "%GENERATOR%" ..
build_script: cmake --build . --config %CONFIGURATION%
test_script: ctest -V --interactive-debug-mode 0 --timeout 300 -C %CONFIGURATION%This should build uncrustify and run the unit tests with VS 2015 32- and 64-bit, and MinGW (albeit a very old version). |
|
The gitattributes file brings the number of failing tests on Windows down to 11: |
|
Added config folder which contains some header/footer files where line endings matter to gitattributes, down to 7 failing tests: |
This provides a way to generate build environments for Windows without having to maintain Visual Studio project files for various versions.
Line endings of the test files matter, so we need to check them out without conversion.
|
Fixed a bug in the generation of |
|
Thanks for creating the CMake file. It makes building it across platforms much easier. Using the current code results in several compiler warnings for me (using Ubuntu Xenial, G++ 5.3.1). I created a PR to address those: #499 |
|
Should the instructions in the README how to build this package be updated to use CMake? The Visual Studio project files could also be removed then. |
As discussed in #470, this is an attempt to add a CMake script that works on both Windows and Linux, and can be used to create build files for Visual Studio.
Since
tests/run_tests.pyassumes the executable is insrc, I added a hack that copies the executable there after build so the unit tests run. It might be preferable if the script took the executable path as an argument.Example use on Linux:
Example use on Windows with a Visual C++ command prompt: