From 4df6d827a1a3837142051de155083a3e36409959 Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Tue, 15 Nov 2016 07:31:39 -0500 Subject: [PATCH] Remove superfluous explicit command for windres/rc CMake handles this properly now, as of CMake 3.5, and this gives us the flexibility to properly start MinGW64 builds --- .gitlab-ci.yml | 16 ++++++++++++++++ CMakeLists.txt | 45 +++++++-------------------------------------- 2 files changed, 23 insertions(+), 38 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index eedb4e6..3f353d6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -53,3 +53,19 @@ build_mingw32: - ./mingw32-build tags: - shared + +build_mingw64: + stage: build + script: + - dnf --quiet --assumeyes install mingw64-gcc mingw64-gcc-c++ mingw64-binutils + - export PKG_CONFIG_LIBDIR="/usr/x86_64-w64-mingw32/sys-root/mingw/lib/pkgconfig:/usr/x86_64-w64-mingw32/sys-root/mingw/share/pkgconfig" + - export PATH=/usr/x86_64-w64-mingw32/bin:$PATH + - mkdir -p x86_64-w64-mingw32 mingw64-build; cd x86_64-w64-mingw32 + - cmake .. -DCMAKE_TOOLCHAIN_FILE=/usr/share/mingw/toolchain-mingw64.cmake -DLUGARU_INSTALL_PREFIX=/builds/osslugaru/lugaru/mingw64-build -DLUGARU_FORCE_INTERNAL_SDL=True -DLUGARU_FORCE_INTERNAL_GLU=True -DLUGARU_FORCE_INTERNAL_JPEG=True -DLUGARU_FORCE_INTERNAL_PNG=True -DLUGARU_FORCE_INTERNAL_VORBIS=True -DLUGARU_FORCE_INTERNAL_ZLIB=True -DLUGARU_FORCE_INTERNAL_OPENAL=True + - make -j4; make install + artifacts: + expire_in: 7d + paths: + - ./mingw64-build + tags: + - shared diff --git a/CMakeLists.txt b/CMakeLists.txt index ff20152..63b5bdc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ project(lugaru) -cmake_minimum_required(VERSION 2.6) +cmake_minimum_required(VERSION 3.5) set(SRCDIR "${CMAKE_CURRENT_SOURCE_DIR}/Source") set(DEPDIR "${CMAKE_CURRENT_SOURCE_DIR}/Dependencies") @@ -137,40 +137,13 @@ if(MSVC) # MSVC non-C99 support biting us hard endif(MSVC) if(WIN32) - if(CMAKE_CROSSCOMPILING) - ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj - COMMAND i686-w64-mingw32-windres - -I${SRCDIR}/win-res - -o ${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj - -i${SRCDIR}/win-res/Lugaru.rc - DEPENDS ${SRCDIR}/win-res/Lugaru.rc - ) - endif(CMAKE_CROSSCOMPILING) - if(NOT CMAKE_CROSSCOMPILING) - if(MSVC) - ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj - COMMAND rc - -I${SRCDIR}/win-res - -fo${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj - ${SRCDIR}/win-res/Lugaru.rc - DEPENDS ${SRCDIR}/win-res/Lugaru.rc - ) - endif(MSVC) - if(MINGW) - ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj - COMMAND windres - -I${SRCDIR}/win-res - -o ${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj - -i${SRCDIR}/win-res/Lugaru.rc - DEPENDS ${SRCDIR}/win-res/Lugaru.rc - ) - endif(MINGW) - endif(NOT CMAKE_CROSSCOMPILING) - - # !!! FIXME: get rid of this. + ENABLE_LANGUAGE(RC) + + # !!! FIXME: get rid of WinDefs.{cpp,h} set(LUGARU_SRCS ${LUGARU_SRCS} - ${SRCDIR}/WinDefs.cpp) + ${SRCDIR}/WinDefs.cpp + ${SRCDIR}/win-res/Lugaru.rc) set(LUGARU_H ${LUGARU_H} @@ -500,11 +473,7 @@ include_directories( set(LUGARU_LIBS ${OPENAL_LIBRARY} ${PNG_LIBRARY} ${JPEG_LIBRARY} ${ZLIB_LIBRARIES} ${SDL_LIBRARY} ${OPENGL_glu_LIBRARY} ${VORBISFILE_LIBRARY} ${OGG_LIBRARY} ${PLATFORM_LIBS}) -if(WIN32) - add_executable(lugaru ${LUGARU_SRCS} ${LUGARU_H} lugaru_resource.obj) -else(WIN32) - add_executable(lugaru ${LUGARU_SRCS} ${LUGARU_H}) -endif(WIN32) +add_executable(lugaru ${LUGARU_SRCS} ${LUGARU_H}) target_link_libraries(lugaru ${LUGARU_LIBS}) -- 2.39.2