Tag with non-integer content breaks rc compilation on windows.

Issue #461 resolved
Brian Schantz created an issue

x265.rc.in gets FILEVERSION and PRODUCTVERSION from the latest tag (see source/CMakeLists.txt#573)

These structures are each a set of 4 integers, and the alpha characters from the tag are causing a syntax error when x265.rc is compiled.

Comments (4)

  1. Pradeep Ramachandran Account Deactivated

    I am building with VS2012 on the latest tip of stable (e1a993e3e052) and things are ok. What changeset/compiler are you trying with?

  2. Brian Schantz reporter

    Sorry for the delay - I'm cross-compiling for win64 on linux, also on the tip of stable, using mingw-w64-x86_64-gcc-8.2.0.

    The issue seems to be that RC in VS (I tested in VS2017 Community) sanitizes the contents of FILEVERSION and PRODUCTVERSION, which windres just throws a syntax error.

    I worked around it by adding these lines to CMakeLists.txt:

    diff -r e1a993e3e052 source/CMakeLists.txt
    --- a/source/CMakeLists.txt     Sat Dec 29 07:21:21 2018 +0100
    +++ b/source/CMakeLists.txt     Tue Jan 01 13:32:30 2019 -0800
    @@ -581,6 +581,8 @@
         string(REPLACE "." ";" VERSION_LIST "${X265_LATEST_TAG}")
         list(GET VERSION_LIST 0 X265_VERSION_MAJOR)
         list(GET VERSION_LIST 1 X265_VERSION_MINOR)
    +    string(REGEX REPLACE "[^0-9]" "" X265_VERSION_MAJOR "${X265_VERSION_MAJOR}")
    +    string(REGEX REPLACE "[^0-9]" "" X265_VERSION_MINOR "${X265_VERSION_MINOR}")
         set(X265_BRANCH_ID 0) # TODO: 0 - stable, 1 - default or other
         set(X265_RC_FILE "${CMAKE_CURRENT_BINARY_DIR}/x265.rc")
         configure_file("${CMAKE_CURRENT_SOURCE_DIR}/x265.rc.in" "${X265_RC_FILE}" @ONLY)
    
  3. Log in to comment