]> git.jsancho.org Git - lugaru.git/commitdiff
Remove superfluous explicit command for windres/rc
authorNeal Gompa <ngompa13@gmail.com>
Tue, 15 Nov 2016 12:31:39 +0000 (07:31 -0500)
committerNeal Gompa <ngompa13@gmail.com>
Tue, 15 Nov 2016 13:40:01 +0000 (08:40 -0500)
CMake handles this properly now, as of CMake 3.5, and this
gives us the flexibility to properly start MinGW64 builds

.gitlab-ci.yml
CMakeLists.txt

index eedb4e6e6a81377ec6e6f6e4d1981c9edf077ea4..3f353d68f157d86fa1d20e07121d5eef172bad35 100644 (file)
@@ -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
index ff201528a71b3242f5c47477a1cbedd7b6cbfe76..63b5bdc3f21fcd9a5c50cc607dd541e9179d01c3 100644 (file)
@@ -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})