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

Can specific cmake generator to use when building #97

Closed
wants to merge 1 commit into from

Conversation

vconcat
Copy link

@vconcat vconcat commented Feb 11, 2021

With these changes, user can build libegit under Windows with toolchain like mingw64-gcc without msys2 environment.
See #83 (comment)

Also, user can specific Ninja generator when available for fast building.

Copy link
Member

@tarsius tarsius left a comment

Choose a reason for hiding this comment

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

Um. Sorry for the delay!

@@ -32,6 +32,11 @@
(unless module-file-suffix
(error "Module support not detected, libgit can't work"))

(defcustom libgit-cmake-generator nil
"CMake generator to use."
Copy link
Member

Choose a reason for hiding this comment

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

Someone who is not familiar with cmake (like me), should still be able to understand what this is all about. As I understand it, this creates build instructions that can later be used by cmake --build instead of creating a Makefile later to be used by make.

@@ -32,6 +32,11 @@
(unless module-file-suffix
(error "Module support not detected, libgit can't work"))

(defcustom libgit-cmake-generator nil
"CMake generator to use."
:type 'string
Copy link
Member

Choose a reason for hiding this comment

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

It can, and by default is, nil. Also what would be a good non-nil value? Is there more than one non-nil value that even makes sense. Either way, a good non-nil value should be provided as a choice, that the user can select without having to learn more about Cmake first.

@@ -65,7 +72,7 @@ On successful exit, pass control on to the build step."
On successful exit, pass control on to the load step."
(let ((default-directory libgit--build-dir))
(set-process-sentinel
(start-process "libgit-cmake" "*libgit build*" "make")
(start-process "libgit-cmake" "*libgit build*" "cmake" "--build" ".")
Copy link
Member

Choose a reason for hiding this comment

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

Will cmake --build . fallback to calling make if we didn't specify a generator above?

Copy link
Contributor

@Thaodan Thaodan Feb 16, 2023

Choose a reason for hiding this comment

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

Cmake will default to the platforms default.

It could also make sense to pass -S to cmake to avoid changing the directory to the source directory.

E.g. cmake -B buildir -S sources.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the feedback, but I have decided to close this until @vconcat gets back to this and makes the requested change and provides all the necessary information in the commit message.

@tarsius
Copy link
Member

tarsius commented Feb 17, 2023

See inline comments.

@tarsius tarsius closed this Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants