Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabled CI MSVC build jobs. #80

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

bjornpiltz
Copy link

  • Added a build matrix
  • Installed Qt through jurplel/install-qt-action (allows for caching)

* Added a build matrix
* Installed Qt through jurplel/install-qt-action (allows for caching)
Fix MSVC error due to WinDef.h redefining min/max.
@dennis2society
Copy link

dennis2society commented Oct 11, 2023

Would you consider to add this line to your #idfef(MSVC) block to suppress all the "inconsistent dll linkage" warnings as proposed in PR
#79?

  # remove warnings about deprecation (CRT, dll linkage,etc) 
   target_compile_options(QGLViewer PRIVATE "/wd4996")

I agree that your ifdef(MSVC) is probably a better solution than the ifdef(WIN32) used in my PR.

@bjornpiltz
Copy link
Author

@dennis2society I fixed the 4996 warnings by defining CREATE_QGLVIEWER_DLL, which was missing. see 20f8aa5.

As of now, building libQLViewer as a DLL is hard coded in the cmake system. It's up to @GillesDebunne to decide if the possibility to build it as a static library should be reintroduced.

Let me know if there is something else essential in your PR which is still missing (I think we can wait with fixing warnings and whitespace issues) otherwise this PR replaces #71 and #79.

@dennis2society
Copy link

dennis2society commented Oct 11, 2023

You're right. I've looked at the output of your CI run and it looks fine. Possibly I have double-fixed this issue in my PR. I will test again with your CMakelists.
Looks like you have everything covered. Nice work. I will close my own PR, no need to have two solutions for the same problem. And yours covers a bit more than mine already.
Since you're at it, maybe you could also integrate #76.
It is only a few lines long.

@bjornpiltz
Copy link
Author

I think I'd prefer not to add #76 to keep this PR minimal. Anyway, I think a cleaner implementation would be:

if(QGLVIEWER_BUILD_EXAMPLES)
    add_subdirectory(examples) # details in examples/CMakeLists.txt
endif() 

Perhaps @fghoussen can resubmit once this gets merged.

@fghoussen
Copy link
Contributor

Perhaps @fghoussen can resubmit once this gets merged.

Sure!

@dennis2society
Copy link

I have tested your CMakeLists and it works fine for me. Suppressing the 4996 warnings on Windows is not necessary. I will close my own PR.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CMake explicitly recommends to set the minimum version before the project name. Could you move the line
cmake_minimum_required(VERSION 3.16) above the project() line?

@fghoussen
Copy link
Contributor

fghoussen commented Oct 12, 2023

So #76 will be merged? If #76 should be modified, just tell me how :)

@bjornpiltz
Copy link
Author

@dennis2society, I'm hesitant to do so since I don't understand the changes made in "Minor tweaks in cmake configuration"
I don't know why the minimum CMake version was raised as high as 3.16 and the cmake_policy() call was added. I would have thought the following two lines would be enough.

cmake_minimum_required(VERSION 3.0)
project(libQGLViewer LANGUAGES CXX VERSION 2.9.1)

@fghoussen, I'm hoping Gilles will merge this PR - then you would need to amend your branch to resolve the conflicts with my changes.

@dennis2society
Copy link

@bjornpiltz The reason I am suggesting this is this warning when running cmake:

CMake Warning (dev) at CMakeLists.txt:5 (project):
cmake_minimum_required() should be called prior to this top-level project()
call.  Please see the cmake-commands(7) manual for usage documentation of
both commands.

Not sure about the CMake version requirements, though.

@fghoussen
Copy link
Contributor

@fghoussen, I'm hoping Gilles will merge this PR - then you would need to amend your branch to resolve the conflicts with my changes.

OK!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants