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

Arantir wip branch: ham-cmake, better gen compile_commands.json, Clang on Windows. #9

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

prenaux
Copy link
Owner

@prenaux prenaux commented Sep 9, 2022

Formal Notes

This PR fixes:

  • RN:
  • RN:
  • RN:

Description, Motivation and Context

  • Link to issue: Fixes ?
  • Link to reference doc: ?

How Has This Been Tested?

Command line to run all the tests that I run locally:

ham Run_ci

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that cause existing functionality to change)
  • Documentation (code docs, comments, or changes to the doc systems)
  • Testing/Build (test coverage or the test/build subsystems themselves)
  • Packaging (adds examples or modifies a release package)

@@ -0,0 +1,31 @@
# base.ham is setup for GCC by default
Copy link
Owner Author

Choose a reason for hiding this comment

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

This should be in toolkit-cpp-clang_33.ham. See the pierre-linux-clang branch (PR #10) where I've done the same thing for Linux.

@@ -0,0 +1,68 @@
# CLANG_EXE_BASE ?= "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/Llvm/bin" ;
Copy link
Owner Author

Choose a reason for hiding this comment

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

Something like CLANG_EXE_BASE should be done in a setup-toolset.sh. See the pierre-linux-clang (PR #10) branch for how I've done that for Linux. In theory there should be much custom code for Clang on Windows.

The main issue should be to update the msvc_19_x64 toolset to have the Microsoft Clang binaries.

@@ -0,0 +1,30 @@
#----------------------------------------------------------------------
Copy link
Owner Author

Choose a reason for hiding this comment

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

See other comments, I'd start from pierre-linux-clang (PR #10) it should be very similar to this.

@@ -0,0 +1,122 @@
if $(BUILD) = da {
Copy link
Owner Author

Choose a reason for hiding this comment

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

See other comments, I'd start from pierre-linux-clang (PR #10) it should be very similar to this.

@@ -0,0 +1,56 @@
::Import("lang.ni")
Copy link
Owner Author

Choose a reason for hiding this comment

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

This looks good, I'd like to take that in.

}
else
{
local key = " SRC_ABSPATH="
Copy link
Owner Author

Choose a reason for hiding this comment

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

why the two spaces at the begining?

@@ -0,0 +1,103 @@
#!/bin/bash
Copy link
Owner Author

Choose a reason for hiding this comment

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

How do you build with ham-cmake?

Is it possible to tell it to output .lib / public headers, etc... in a specific folder?

Could it keep the build stuff in ~/_ham/something and copy the .libs, etc... in the standard niLang/libs/ folder ?

fi

if [ -z "$BUILD_GENERATOR" ]; then
# BUILD_GENERATOR="Ninja"
Copy link
Owner Author

Choose a reason for hiding this comment

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

We could add Ninja in a toolset and make the cmake toolset depend on it, my worry though is how do we make it find ham's MSVC/Clang/GCC. With make it should be fairly simple? Or is that what the $BUILD_ARCH.cmake files above do?

@@ -0,0 +1,44 @@
set(CMAKE_SYSTEM_NAME Windows)
Copy link
Owner Author

Choose a reason for hiding this comment

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

Mmmm, x86_x64-msys? is that for Clang?


# Global flags
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
add_c_flag(
Copy link
Owner Author

Choose a reason for hiding this comment

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

So this one is on me, but we should stop disabling warnings in the build scripts - including the .ham. We can actually put all of those in pragmas. Which is a lot less ugly... even though ideally our code should need those at all in an ideal world...

@prenaux prenaux changed the title Arantir ham gen commands Arantir wip branch: ham-cmake, better gen compile_commands.json, Clang on Windows. Sep 9, 2022
@prenaux prenaux added the wip 👷 Wip & Experimental, will or wont be done/merged label Sep 27, 2022
@ArantirZhang ArantirZhang force-pushed the arantir-ham-gen-commands branch 3 times, most recently from d2b389a to d97153c Compare October 13, 2022 14:01
@prenaux prenaux force-pushed the master branch 20 times, most recently from 8135e11 to 313cfa2 Compare October 23, 2022 13:04
@ArantirZhang ArantirZhang force-pushed the arantir-ham-gen-commands branch from 218391c to 020af2c Compare January 6, 2025 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wip 👷 Wip & Experimental, will or wont be done/merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants