-
Notifications
You must be signed in to change notification settings - Fork 114
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
CMake based build produces executable with more dependencies #39
Comments
To do this you can switch to use Windows STATIC runtime libs... As an CMake OPTION -
Have done this in my fork, https://github.com/geoffmcl/winflexbison, in the HTH |
Hm, @geoffmcl does this remove the need to install the VC runtime? if it doesn't then there may not be much reason to (as the runtime dlls would still need to have been installed on the system). In any case: if the project files have those switches applied the PR would be useful; both @lexxmark and me don't know much about CMAKE + VS, there may be a direct option (at least now, as we use "newer cmake environments" - @Croydon any insights)? |
@GitMensch it certainly does ... ;=)) Compare a CMake build without it -
And then my fork build -
Chaulk and Cheese ;=))
Ok, that explains some rather weird, unnessessary, ... and some missing... things in the CMakeLists.txt files... ;=)) Like why set CMAKE_CXX_FLAGS_XXX vars, in what seems like a And missing, in Anyway, these are not particularly a problem... so no problem, really... just saying... |
@geoffmcl I suggest to start a PR for any cmake related issues you see (however you like either "split" or one combined one). Ideally @Croydon can comment on those, too. Ideally we also get at least one environment running via cmake that uses Mingw as those should allow us to run tests at least in this environment (so far we only build Bison and Flex); but this one really should be a separated PR :-) |
@GitMensch added PR #52, for at least the STATIC runtimes.... Will hold off on other suggestions, for now... and further feedback... And yes, it should be easily possible to build a Mingw version, using CMake... I do it now and then with other projects... I am presently struggling with where/how to install win_flex, and win_bison, with its dependence on a Other packages use like |
Hi there, Sorry for delay and thank you guys for help and clarification. I will use STATIC switcher to prepare releases, because the initial idea was to have as minimum dependencies as possible.
"data" sub-directory is a part of original GNU bison project and win_bison behaves in a similar way.
User specific locations used for user specific data usually. As I said in our case it's more similar to resource files. Any comments/suggestions on this are appreciated |
@lexxmark certainly agree with the idea of releasing Windows binary EXE files, with the minimum of dependencies as possible... if you are prepared for the extra effort... like using the But do not always do it myself ;=(( since the MSVC runtimes is free download and install... In addition, as another alternative, is to build using MingW/Mingw-w64 - which I again sometimes do - but wonder why you restrict this with, in root CMakeLists.txt -
However, I tried changing that to only a
Have not yet looked at it deeply, but seem it could be fixed... if I get the time... but why the restriction? Is there something else I am missing? Yes, thanks for the I have a simple path, That ZIP has things like And yes, I accidentally suggested I meant the hidden It seems that would be a closer Windows equivalent to the Anyway, just, hopefully, helpful suggestions... Meantime I have installed your ZIP in This all started because I was trying to build |
If I remember correctly @Croydon made CMake files for win_flex_bison and this restriction was there initially. I guess this check just limits tested environments/compilers. If we manage to fix mingw toolchain, we could remove or loose this restriction.
This environment variable (like PATH) that points to "\data" folder (if it is not in win_bison.exe folder). So you can place "\data" folder in more appropriate place at installation and make a system environment variable BISON_PKGDATADIR to point to this folder. Or set local BISON_PKGDATADIR every time you call win_bison.exe
I see the point now. That make sense. Does other tools grep, tail... have zip file or installation that just have only exe files? Could you give me an example.
Zip archive itself cannot put "\data" folder into "%ProgramData%\bison" or wherever. So I guess you are talking about conan/chocolatey install scripts. Am I right?
|
No, actually it was you who created the CMake files with this restriction 😄 |
@Croydon Sorry, my fault - it seems I made cmake config files using some template that had such a restricton. |
We found out that the difference is because of the different build environment and that the standard for the existing projects (static linking of VS-Runtime) is reasonable. Some future date someone should merge the changes of master to the 2.7 branch but this isn't reasonable if there are no other changes there (which currently isn't the case) [sole exception: if @geoffmcl finishes the MinGW build, providing a completely new target]. |
@lexxmark, @Croydon, @GitMensch, thank you for the additional feedback, merge, and information... Of course, do not agree with the removal of the second Yes, the fact that you use a simple ZIP format to distribute your releases is a bit of a problem, since And this is not the case for the small number of unix utils for window, that I use... but I do now note they do include So, the windows user must be savvy enough to unzip your ZIP somewhere appropriate, typically say Another alternative to ZIP distribution, are Windows installers, like NSIS, Chocolatey, vcpkg, etc, etc, etc... which can do all/most of the above steps for the user... have used some of these... with reasonable succeess... but this is somewhat unusual for command line apps, but not unheard of... 7-zip being one, in And this sort of overloads the PATH environment... in my case it is already about 2K in length, some 50 So, yes, I have been eyeing the Concerning a It would be possible to code a HTH... |
Just a note: I've rechecked with current MSYS2 - doesn't build at all with cmake (neither msys nor mingw32 target) because of m4/builtin.c + regex; did I do something wrong? |
Executables from solution files have following dependencies:
win_bison -> kernel32.dll
win_flex -> kernel32.dll, ws2_32.dll
CMake based builds:
win_bison -> kernel32.dll, vcruntime140.dll
win_flex ->kernel32.dll, ws2_32.dll, vcruntime140.dll
The text was updated successfully, but these errors were encountered: