Skip to content
Permalink
Browse files

fix appveyor visual studio build

See #465

To compile the build tool `bin2c`, add a target with `add_executable()`
on visual studio instead of using `HostCompile.cmake` because running
`cl.exe` fails in the appveyor visual studio environment, see:

https://developercommunity.visualstudio.com/content/problem/325122/c1356-unable-to-find-mspdbcoredll.html

Also update the dependencies module to latest.

appveyor build now tested to work.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
  • Loading branch information
rkitover committed Aug 20, 2019
1 parent a8b7b72 commit 8ceef90fc4882ac9e549c831e1f3f725a1147d23
Showing with 22 additions and 20 deletions.
  1. +1 −1 README.md
  2. +3 −9 appveyor.yml
  3. +3 −3 cmake/HostCompile.cmake
  4. +1 −1 dependencies
  5. +14 −6 src/wx/CMakeLists.txt
@@ -16,7 +16,7 @@

[![Join the chat at https://gitter.im/visualboyadvance-m/Lobby](https://badges.gitter.im/visualboyadvance-m/Lobby.svg)](https://gitter.im/visualboyadvance-m/Lobby)
[![Build Status](https://travis-ci.org/visualboyadvance-m/visualboyadvance-m.svg?branch=master)](https://travis-ci.org/visualboyadvance-m/visualboyadvance-m)
[![Coverity Scan Build Status](https://scan.coverity.com/projects/16096/badge.svg)](https://scan.coverity.com/projects/visualboyadvance-m-visualboyadvance-m)
[![Build status](https://ci.appveyor.com/api/projects/status/5ckx25vct1q1ovfc?svg=true)](https://ci.appveyor.com/project/ZachBacon65337/visualboyadvance-m-2ys5r)

# Visual Boy Advance - M

@@ -1,15 +1,10 @@
version: '{build}'
branches:
only:
- master

image:
- Visual Studio 2017

configuration:
- Debug

#let's start with 64bit
- Release

platform:
- x64
@@ -24,9 +19,8 @@ matrix:
before_build:
- cmd: |-
mkdir build
git submodule update --init --recursive
cd build
cmake .. -G "Visual Studio 15 2017" -DVCPKG_TARGET_TRIPLET=x64-windows
cmake .. -DVCPKG_TARGET_TRIPLET=x64-windows
build_script:
- cmake --build .
- msbuild /m ALL_BUILD.vcxproj -p:Configuration=Release
@@ -18,12 +18,12 @@ function(host_compile src dst_cmd)
set(compile_command cc ${src} -o ${dst} ${link_flags})
else()
# special case for Visual Studio
set(compile_command cl ${src} /link "/out:${dst}")
set(compile_command ${CMAKE_C_COMPILER} ${src} /link "/out:${dst}")
endif()

execute_process(COMMAND ${compile_command} OUTPUT_VARIABLE compile_out ERROR_VARIABLE compile_out RESULT_VARIABLE compile_result)
execute_process(COMMAND ${compile_command} OUTPUT_VARIABLE compile_out ERROR_VARIABLE compile_err RESULT_VARIABLE compile_result)

if(NOT compile_result EQUAL 0)
message(FATAL_ERROR "Failed compiling ${src} for the host: ${compile_out}")
message(FATAL_ERROR "Failed compiling ${src} for the host: ${compile_err}")
endif()
endfunction()
Submodule dependencies updated 1164 files
@@ -515,11 +515,19 @@ set(XRC_SOURCES
# wxrc does not support xrs files in -c output (> 10x compression)
# we do it using the bin2c.c utility

set(BIN2C ${CMAKE_BINARY_DIR}/bin2c)
set(BIN2C ${CMAKE_BINARY_DIR}/bin2c${CMAKE_EXECUTABLE_SUFFIX})

include(HostCompile)

host_compile(${CMAKE_CURRENT_SOURCE_DIR}/bin2c.c ${BIN2C})
if(NOT MSVC)
include(HostCompile)
host_compile(${CMAKE_CURRENT_SOURCE_DIR}/bin2c.c ${BIN2C})
set(BIN2C_DEP ${BIN2C})
else()
# on the appveyor visual studio environment, cl.exe cannot be run from
# cmake
add_executable(bin2c ${CMAKE_CURRENT_SOURCE_DIR}/bin2c.c)
set(BIN2C bin2c)
set(BIN2C_DEP bin2c)
endif()

if(WXRC)
separate_arguments(WXRC UNIX_COMMAND ${WXRC})
@@ -596,14 +604,14 @@ add_custom_command(
add_custom_command(
OUTPUT builtin-xrc.h
COMMAND ${BIN2C} wxvbam.xrs builtin-xrc.h builtin_xrs
DEPENDS wxvbam.xrs
DEPENDS wxvbam.xrs ${BIN2C_DEP}
)

# use a built-in vba-over.ini if no config file present
add_custom_command(
OUTPUT builtin-over.h
COMMAND ${BIN2C} ${CMAKE_CURRENT_SOURCE_DIR}/../vba-over.ini builtin-over.h builtin_over
DEPENDS ../vba-over.ini
DEPENDS ../vba-over.ini ${BIN2C_DEP}
)

# I don't like duplicating/triplicating code, so I only declare

0 comments on commit 8ceef90

Please sign in to comment.
You can’t perform that action at this time.