ci: Add Gitlab CI config for cmake build

This commit is contained in:
Eidolon 2022-11-12 00:19:05 -06:00
parent b9c677e537
commit 2b1d03aa16
2 changed files with 25 additions and 3 deletions

21
.gitlab-ci.yml Normal file
View file

@ -0,0 +1,21 @@
build:
image:
name: purplekarrot/mingw-w64-i686:latest
entrypoint: [""]
artifacts:
paths:
- build/bin/*.exe
- build/bin/*.exe.debug
expire_in: 1 day
script:
- apt-get -qq update && apt-get -qq install -y --no-install-recommends git
- mkdir -p .cpm
- mkdir -p build
- cd build
- >
cmake -G "Ninja"
"-DCPM_SOURCE_CACHE=$CI_PROJECT_DIR/.cpm"
-DCMAKE_TOOLCHAIN_FILE=/toolchain.cmake
-DCMAKE_BUILD_TYPE=Debug
..
- ninja -j 1

View file

@ -91,6 +91,7 @@ if(NOT "${SRB2_CONFIG_SYSTEM_LIBRARIES}")
configure_file("${ZLIB_SOURCE_DIR}/zlib.pc.cmakein" "${ZLIB_BINARY_DIR}/zlib.pc" @ONLY) configure_file("${ZLIB_SOURCE_DIR}/zlib.pc.cmakein" "${ZLIB_BINARY_DIR}/zlib.pc" @ONLY)
configure_file("${ZLIB_SOURCE_DIR}/zconf.h.cmakein" "${ZLIB_BINARY_DIR}/include/zconf.h" @ONLY) configure_file("${ZLIB_SOURCE_DIR}/zconf.h.cmakein" "${ZLIB_BINARY_DIR}/include/zconf.h" @ONLY)
configure_file("${ZLIB_SOURCE_DIR}/zlib.h" "${ZLIB_BINARY_DIR}/include/zlib.h" @ONLY)
add_library(ZLIB ${SRB2_INTERNAL_LIBRARY_TYPE} ${ZLIB_SRCS}) add_library(ZLIB ${SRB2_INTERNAL_LIBRARY_TYPE} ${ZLIB_SRCS})
set_target_properties(ZLIB PROPERTIES set_target_properties(ZLIB PROPERTIES
@ -173,8 +174,8 @@ if(NOT "${SRB2_CONFIG_SYSTEM_LIBRARIES}")
target_include_directories(png PUBLIC "${png_BINARY_DIR}/include") target_include_directories(png PUBLIC "${png_BINARY_DIR}/include")
# ... and these also need to be present only for png build # ... and these also need to be present only for png build
target_include_directories(png PRIVATE "${zlib_SOURCE_DIR}") target_include_directories(png PRIVATE "${ZLIB_SOURCE_DIR}")
target_include_directories(png PRIVATE "${zlib_BINARY_DIR}") target_include_directories(png PRIVATE "${ZLIB_BINARY_DIR}")
target_include_directories(png PRIVATE "${png_BINARY_DIR}") target_include_directories(png PRIVATE "${png_BINARY_DIR}")
target_link_libraries(png PRIVATE ZLIB::ZLIB) target_link_libraries(png PRIVATE ZLIB::ZLIB)
@ -495,7 +496,7 @@ if(NOT "${SRB2_CONFIG_SYSTEM_LIBRARIES}")
if("${CMAKE_C_COMPILER_ID}" STREQUAL GNU OR "${CMAKE_C_COMPILER_ID}" STREQUAL Clang OR "${CMAKE_C_COMPILER_ID}" STREQUAL AppleClang) if("${CMAKE_C_COMPILER_ID}" STREQUAL GNU OR "${CMAKE_C_COMPILER_ID}" STREQUAL Clang OR "${CMAKE_C_COMPILER_ID}" STREQUAL AppleClang)
target_compile_options(openmpt PRIVATE "-g0") target_compile_options(openmpt PRIVATE "-g0")
endif() endif()
if("${CMAKE_SYSTEM_NAME}" STREQUAL Windows) if("${CMAKE_SYSTEM_NAME}" STREQUAL Windows AND "${CMAKE_C_COMPILER_ID}" STREQUAL MSVC)
target_link_libraries(openmpt PRIVATE Rpcrt4) target_link_libraries(openmpt PRIVATE Rpcrt4)
endif() endif()
target_compile_features(openmpt PRIVATE cxx_std_11) target_compile_features(openmpt PRIVATE cxx_std_11)