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

xplat: add ChakraCoreHeaders target. #2129

Closed

Conversation

kphillisjr
Copy link
Contributor

Currently only the ChakraCore shared library uses this target, however this
target is also extremely useful for Static Library builds. To use this
target with any other target library/executable, simply add the following
line to cmake:

add_dependencies(myTarget ChakraCoreHeaders)

/cc @obastemur - Here is your request for adding a target for ChakraCoreHeaders. Also, this is future proofed a little for if/when using cmake to target MSVC/windows is added.

Currently only the ChakraCore shared library uses this target, however this
target is also extremely useful for Static Library builds. To use this
target with any other target library/executable, simply add the following
line to cmake:

add_dependencies(myTarget ChakraCoreHeaders)
@msftclas
Copy link

msftclas commented Dec 1, 2016

Hi @kphillisjr, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!
You've already signed the contribution license agreement. Thanks!

The agreement was validated by Microsoft and real humans are currently evaluating your PR.

TTYL, MSBOT;

Copy link
Collaborator

@obastemur obastemur left a comment

Choose a reason for hiding this comment

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

@kphillisjr Good job. Couple of changes and rest looks fine.

@@ -52,3 +52,25 @@ target_include_directories (
../Runtime/Debug
../Parser
)


add_custom_target(ChakraCoreHeaders ALL
Copy link
Collaborator

Choose a reason for hiding this comment

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

We need to have this under if(NOT CC_XCODE_PROJECT) otherwise xcode build would break.

"${CMAKE_BINARY_DIR}/include"
)

if(MSVC OR WIN32)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is not necessary better not add.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I got ChakraCore to compile using MSVC 2015 and cmake, so this change is useful.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@kphillisjr I'm not saying we can't do that. The problem is that preprocessor flags we set and source files we do include on CMake xplat is not necessarily matching what we supposed to do for Windows. For the best ChakraCore experience on Windows, we better use msbuild with sln file.

@@ -75,3 +75,6 @@ if(NOT CC_XCODE_PROJECT)
${CHAKRACORE_BINARY_DIR}/
)
endif()

add_dependencies(ChakraCore ChakraCoreHeaders)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need to add the same to /bin/ch/CMakeLists.txt for STATIC builds?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am in the process of adding major revisions to the xplat build system. These revisions have three main features...

  1. Greatly reduces compile time for swap between Shared and Static Libraries... This means that a minimal number of files get changed each time.
  2. A new ChakraCoreStatic target. This is simply the ChakraCore target with the static preprocessor define added.
  3. The number of static libraries is reduced by converting the existing library to an object.

Copy link
Collaborator

@obastemur obastemur Dec 1, 2016

Choose a reason for hiding this comment

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

We better add it here now and if another PR will change that later, that is something else.

kphillisjr added a commit to kphillisjr/ChakraCore that referenced this pull request Dec 8, 2016
This target automatically copies the ChakraCore Headers to the the path
that cmake is ran from under the include folder. This makes it easier to
find the headers needed for ChakraCore Development.

V2: add suggestions mentioned by review in pull request chakra-core#2129.
@obastemur
Copy link
Collaborator

@kphillisjr ping?

@kphillisjr
Copy link
Contributor Author

Closing this pull request... It is superseded by pull request #2678.

@kphillisjr kphillisjr closed this Mar 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants