novelrt / NovelRT

A cross-platform 2D game engine accompanied by a strong toolset for visual novels.
MIT License
183 stars 43 forks source link

NovelRT.Tests does not compile with same compiler flags as Engine or Interop #506

Closed capnkenny closed 1 year ago

capnkenny commented 1 year ago

It currently appears that the compiler flags defined for Engine or Interop are not being defined for the tests, as shown below. This issue is to apply the same compiler flags (or as many as possible) to the NovelRT.Tests subproject and to apply corrections to tests as needed. Further questions can be answered on this issue thread or in Discord 😄

if(MSVC)
  #...
  target_compile_options(Engine
    PRIVATE
      /W4
      /WX
      /wd4611
      /MP
  )
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
  target_compile_options(Engine
    PRIVATE
      -pedantic
      -pedantic-errors
      -Wall
      -Wextra
      -Werror
      -Wno-float-equal
      -Wno-padded
  )
else()
  target_compile_options(Engine
    PRIVATE
      -pedantic
      -pedantic-errors
      -Wall
      -Wextra
      -Werror
      -Wno-c++98-compat
      -Wno-c++98-compat-pedantic
      -Wno-float-equal
      -Wno-padded
      -Wno-reserved-id-macro
  )
endif()
bjauny commented 1 year ago

Hi, I started to look at this. If I get it right, I need to set the options defined in the CMakeLists.txt of NovelRT.Interop in the one for NovelRT.Tests (using the target Engine_Tests in place of Interop). I'll update the tests code along since it breaks things so far. :)