Commit ea7413f4 authored by Florian Oetke's avatar Florian Oetke
Browse files

Merge remote-tracking branch 'origin/feature/windows_ci' into develop

parents db016d27 fcc4118c
......@@ -5,54 +5,65 @@ stages:
variables:
GIT_SUBMODULE_STRATEGY: recursive
build_gcc:
stage: build
script:
- export CC=gcc
- export CXX=g++
- mkdir -p build
- cd build
- mkdir -p bin
- rm -rf src
- cmake -G Ninja -DCMAKE_INSTALL_PREFIX:PATH=../bin -DCMAKE_BUILD_TYPE=Release -DMIRRAGE_EXPORT_EXECUTABLE=ON ..
- cmake --build . --target src/install
- cmake --build . --target test
.cache-paths-spec: &cache-paths
- build
.linux-cache-spec: &linux-cache-spec
cache:
key: ${CI_COMMIT_REF_SLUG}-${CI_JOB_NAME}
paths: *cache-paths
.windows-cache-spec: &windows-cache-spec
cache:
paths: *cache-paths
key: "%CI_COMMIT_REF_SLUG%-%CI_JOB_NAME%-%CI_RUNNER_ID%"
.windows-task: &windows-task
tags:
- windows
only:
variables:
- $WINDOWS_CI
.artifact-spec: &artifact-spec
artifacts:
name: "mirrage"
paths:
- build/bin
- mirrage
expire_in: 1 day
cache:
key: "gcc_${CI_COMMIT_REF_SLUG}"
paths:
- build
build_clang:
.build-ninja-linux: &build-ninja-linux
stage: build
script:
- export CC=clang
- export CXX=clang++
- mkdir -p build
- cmake -E make_directory build
- cd build
- mkdir -p bin
- rm -rf src
- cmake -G Ninja -DCMAKE_INSTALL_PREFIX:PATH=../bin -DCMAKE_BUILD_TYPE=Release -DMIRRAGE_EXPORT_EXECUTABLE=ON ..
- cmake -E remove_directory src
- cmake -G Ninja -DCMAKE_INSTALL_PREFIX:PATH=../../mirrage -DCMAKE_BUILD_TYPE=Release -DMIRRAGE_EXPORT_EXECUTABLE=ON ..
- cmake --build . --target src/install
- cmake --build . --target test
artifacts:
paths:
- build/bin
expire_in: 1 week
cache:
key: "clang_${CI_COMMIT_REF_SLUG}"
paths:
- build
<<: *linux-cache-spec
<<: *artifact-spec
build-gcc:
variables:
CC: "gcc"
CXX: "g++"
<<: *build-ninja-linux
build-clang:
variables:
CC: "clang"
CXX: "clang++"
<<: *build-ninja-linux
build_scanbuild:
build-scanbuild:
stage: build
script:
- export CC=clang
- export CXX=clang++
- export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc --all)
- echo "Build parallelism:" ${CMAKE_BUILD_PARALLEL_LEVEL}
- mkdir -p build
- cd build
- scan-build --use-c++=clang++ --use-cc=clang cmake -DMIRRAGE_FORCE_LIBCPP=ON -DMIRRAGE_ENABLE_COTIRE=OFF -G "Unix Makefiles" ..
......@@ -63,4 +74,32 @@ build_scanbuild:
expire_in: 1 week
when: always
build-mingw:
stage: build
script:
- cmake -E make_directory build
- cd build
- cmake -E remove_directory src
- cmake -G Ninja -DCMAKE_INSTALL_PREFIX:PATH=../../mirrage -DCMAKE_BUILD_TYPE=Release -DMIRRAGE_ENABLE_COTIRE=OFF -DMIRRAGE_EXPORT_EXECUTABLE=ON ..
- cmake --build . --target src/install
- cmake --build . --target test
variables:
CC: "gcc"
CXX: "g++"
<<: *windows-task
<<: *windows-cache-spec
<<: *artifact-spec
build-msvc:
stage: build
script:
- cmake -E make_directory build
- cd build
- cmake -E remove_directory src
- cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_INSTALL_PREFIX:PATH=../../mirrage -DMIRRAGE_EXPORT_EXECUTABLE=ON -DMIRRAGE_ENABLE_BACKWARD=OFF ..
- cmake --build . --config Release -- /m
- cmake --build . --config Release --target src/install
- cmake --build . --config Release --target RUN_TESTS
<<: *windows-task
<<: *windows-cache-spec
<<: *artifact-spec
......@@ -25,6 +25,6 @@ endif()
add_subdirectory(dependencies)
add_subdirectory(src)
if(MSVC)
if(MSVC_IDE)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT demo)
endif()
......@@ -94,7 +94,9 @@ if(MIRRAGE_ENABLE_COTIRE)
if(COMMAND cotire)
add_definitions(-DGLM_FORCE_RADIANS -DGLM_FORCE_DEPTH_ZERO_TO_ON -DGLM_ENABLE_EXPERIMENTAL -DGLM_FORCE_CXX14)
add_compile_options(-pthread)
if(NOT MSVC)
add_compile_options(-pthread)
endif()
set_property(GLOBAL PROPERTY COTIRE_PREFIX_HEADER_INCLUDE_PATH "${MIRRAGE_ROOT_DIR}/dependencies")
set_property(GLOBAL PROPERTY COTIRE_PREFIX_HEADER_IGNORE_PATH "${MIRRAGE_ROOT_DIR}/dependencies/nuklear;${MIRRAGE_ROOT_DIR}/src;${MIRRAGE_ROOT_DIR}/dependencies/moodycamel/concurrentqueue.h")
set_property(GLOBAL PROPERTY COTIRE_ADD_UNITY_BUILD FALSE)
......
......@@ -34,7 +34,7 @@ target_link_libraries(demo
doctest
)
if (WIN32)
if(CMAKE_CXX_COMPILER_ID MATCHES GNU)
if(MINGW)
target_link_libraries(demo
PRIVATE
mingw32
......@@ -56,6 +56,6 @@ if(COMMAND cotire)
cotire(demo)
endif()
if(MSVC)
if(MSVC_IDE)
set_property(TARGET demo PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "${MIRRAGE_ROOT_DIR}/assets")
endif()
......@@ -126,7 +126,7 @@ namespace mirrage {
if(headless) {
#ifdef _WIN32
// TODO
(void) sigIntHandler;
(void) (&sigIntHandler);
#else
struct sigaction action;
action.sa_handler = sigIntHandler;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment