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

[cmake] Make it possible to override default cmake options #127

Closed
stanhu opened this issue Jul 14, 2023 · 2 comments · Fixed by #129
Closed

[cmake] Make it possible to override default cmake options #127

stanhu opened this issue Jul 14, 2023 · 2 comments · Fixed by #129

Comments

@stanhu
Copy link
Contributor

stanhu commented Jul 14, 2023

While working on mudge/re2#67, I found that the default cmake generator option for Windows builds did not work for the abseil-cpp project:

# docker run -it -v $(pwd):/build ghcr.io/rake-compiler/rake-compiler-dock-image:1.3.0-mri-x64-mingw-ucrt bash
root@2cf282c35cc8:/tmp# git clone --depth 1 https://github.com/abseil/abseil-cpp.git
Cloning into 'abseil-cpp'...
remote: Enumerating objects: 1438, done.
remote: Counting objects: 100% (1438/1438), done.
remote: Compressing objects: 100% (1159/1159), done.
remote: Total 1438 (delta 401), reused 527 (delta 275), pack-reused 0
Receiving objects: 100% (1438/1438), 2.49 MiB | 7.43 MiB/s, done.
Resolving deltas: 100% (401/401), done.
 root@2cf282c35cc8:/tmp# cd abseil-cpp/
root@2cf282c35cc8:/tmp/abseil-cpp# mkdir build
root@2cf282c35cc8:/tmp/abseil-cpp# cd build
root@2cf282c35cc8:/tmp/abseil-cpp/build# cmake .. -G 'MSYS Makefiles'
CMake Error: Could not create named generator MSYS Makefiles

Generators
* Unix Makefiles               = Generates standard UNIX makefiles.
  Green Hills MULTI            = Generates Green Hills MULTI files
                                 (experimental, work-in-progress).
  Ninja                        = Generates build.ninja files.
  Watcom WMake                 = Generates Watcom WMake makefiles.
  CodeBlocks - Ninja           = Generates CodeBlocks project files.
  CodeBlocks - Unix Makefiles  = Generates CodeBlocks project files.
  CodeLite - Ninja             = Generates CodeLite project files.
  CodeLite - Unix Makefiles    = Generates CodeLite project files.
  Sublime Text 2 - Ninja       = Generates Sublime Text 2 project files.
  Sublime Text 2 - Unix Makefiles
                               = Generates Sublime Text 2 project files.
  Kate - Ninja                 = Generates Kate project files.
  Kate - Unix Makefiles        = Generates Kate project files.
  Eclipse CDT4 - Ninja         = Generates Eclipse CDT 4.0 project files.
  Eclipse CDT4 - Unix Makefiles= Generates Eclipse CDT 4.0 project files.

I worked around the problem by pruning the -G option from configure_options, but it'd be nice to make it easier to skip this.

@flavorjones
Copy link
Owner

Ack. CMake is still "experimental" and you may be the first person to really try to use it for something. Will take a look, but prioritizing it behind some other work at the moment.

@stanhu
Copy link
Contributor Author

stanhu commented Jul 16, 2023

It seems that

isn't needed when cross-compiling in Linux, but the flag is needed in Windows.

stanhu added a commit to stanhu/mini_portile that referenced this issue Jul 17, 2023
When cross-compiling Windows targets with `cmake` in a Linux
environment, the MSYS generator may not be available. Supplying `-G
MSYS` will cause the build to fail.

`cmake --help` will output the available generators. Before including
the `-G` option, check that the generator is available.

Closes flavorjones#127
stanhu added a commit to stanhu/mini_portile that referenced this issue Jul 17, 2023
When cross-compiling Windows targets with `cmake` in a Linux
environment, the MSYS generator may not be available. Supplying `-G
MSYS` will cause the build to fail.

`cmake --help` will output the available generators. Before including
the `-G` option, check that the generator is available.

Closes flavorjones#127
stanhu added a commit to stanhu/mini_portile that referenced this issue Jul 17, 2023
When cross-compiling Windows targets with `cmake` in a Linux
environment, the MSYS generator may not be available. Supplying `-G
MSYS` will cause the build to fail.

`cmake --help` will output the available generators. Before including
the `-G` option, check that the generator is available.

Closes flavorjones#127
stanhu added a commit to stanhu/mini_portile that referenced this issue Jul 17, 2023
When cross-compiling Windows targets with `cmake` in a Linux
environment, the MSYS generator may not be available. Supplying `-G
MSYS` will cause the build to fail.

`cmake --help` will output the available generators. Before including
the `-G` option, check that the generator is available.

Closes flavorjones#127
stanhu added a commit to stanhu/mini_portile that referenced this issue Jul 17, 2023
When cross-compiling Windows targets with `cmake` in a Linux
environment, the MSYS generator may not be available. Supplying `-G
MSYS` will cause the build to fail.

`cmake --help` will output the available generators. Before including
the `-G` option, check that the generator is available.

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

Successfully merging a pull request may close this issue.

2 participants