Skip to content

Commit

Permalink
Added example using Buck with Visual Studio Code on Windows
Browse files Browse the repository at this point in the history
Summary:
1. I made the default platform in the prelude public so it can be inherited from. I don't know why it wasn't already like that. Maybe I'm misunderstanding how to use it
2. Not sure if I'm using the config_setting and constraint_setting properly since it seems duplicated.
3. The script to generate the compile_commands.json was more or less copied from facebook/buck2#510.

There are still a lot of improvements to be made but I think this is good enough to be merged:
1. With MSVC the compilation should probably be done with /Z7 by default and then, if the "stripped" sub-target is asked for, that flag is removed.
2. The cxx toolchain needs the compilation options looked at, not sure if Linux's defaults work properly.
3. The Install.ps1 and Copy.ps1 need to be ported to Linux.

X-link: facebook/buck2#517

Reviewed By: KapJI

Differential Revision: D53692733

Pulled By: JakobDegen

fbshipit-source-id: 8d5962084831a3cccde128f0aa0360a1aaf72004
  • Loading branch information
Overhatted authored and facebook-github-bot committed Feb 21, 2024
1 parent c5b2d1b commit 7e43183
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 1 addition & 0 deletions platforms/BUCK.v2
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ execution_platform(
cpu_configuration = host_configuration.cpu,
os_configuration = host_configuration.os,
use_windows_path_separators = host_info().os.is_windows,
visibility = ["PUBLIC"],
)

prelude.constraint_setting(
Expand Down
1 change: 0 additions & 1 deletion toolchains/cxx.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ def _system_cxx_toolchain_impl(ctx: AnalysisContext):
shared_library_name_default_prefix = ""
shared_library_name_format = "{}.dll"
shared_library_versioned_name_format = "{}.dll"
additional_linker_flags = ["msvcrt.lib"]
pic_behavior = PicBehavior("not_supported")
elif ctx.attrs.linker == "g++" or ctx.attrs.cxx_compiler == "g++":
pass
Expand Down

0 comments on commit 7e43183

Please sign in to comment.