1067 Commits

Author SHA1 Message Date
Flarnie Marchan
57fe28235a Add CODE_OF_CONDUCT.md
**what is the change?:**
Adding a document linking to the Facebook Open Source Code of Conduct,
for visibility and to meet Github community standards.

**why make this change?:**
It's important that contributors can find the Code of Conduct for a
project.

xcbuild already links to a Code of Conduct in the Contributing guide, which is
great! :)

Exposing the COC via a separate markdown file is a standard being
promoted by Github via the Community Profile in order to meet their Open
Source Guide's recommended community standards.

As you can see, adding this file will complete [xcbuild's Community Profile](https://github.com/facebook/xcbuild/community)
checklist and increase the visibility of our COC.

**test plan:**
Viewing it on my branch -
(Flarnie will insert a screenshot)

**issue:**
internal task t23481323
2018-01-22 00:49:27 -08:00
IOhannes m zmölnig
72ba47965d print usage parsing the cmdline args resulted in an error
Closes: https://github.com/facebook/xcbuild/issues/274
2018-01-22 00:49:04 -08:00
IOhannes m zmölnig
eec239c50f Added "-help" to usage examples 2018-01-22 00:49:04 -08:00
IOhannes m zmölnig
8c5fd8168a Added comment why we need to undefine major/minor 2018-01-22 00:48:43 -08:00
IOhannes m zmölnig
1d79837817 undefine major/minor macros to prevent build failures with newer glibc 2018-01-22 00:48:43 -08:00
Saleem Abdulrasool
8433d68034 libcar: silence a -Wsign-compare warning
When building libcar for Windows, the array size calculation would be of type
`unsigned long long` (aka `size_t`).  However, `identifier` is of type
`enum car_attribute_identifier` (aka `int`).  This results in a warning due to
the sign mismatch.  Perform an explicit cast to the size type for the
comparision to silence the warning.

Take the opportunity to move the constant expression of the array length into a
variable for ease of readability.
2018-01-22 00:48:08 -08:00
Stephane Sezer
0a2246ec23 Extra error checking for zero-size files on Windows
We can't map zero-size files on Windows, we need to check for these
values before calling `CreateFileMapping`.
2017-12-18 13:14:35 -08:00
Stephane Sezer
376d9c5a7f Properly check for errors with CreateFileMapping
On error, `CreateFileMapping` returns NULL, not INVALID_HANDLE_VALUE.
2017-12-18 13:14:35 -08:00
Stephane Sezer
0541214d71 Fix calls to ReadFile and WriteFile on Windows pre-10
Only one of the two last arguments to these functions can be null, not
both. This works on Windows 10 but crashes on Windows 7.
2017-12-18 12:43:15 -08:00
Kellie Medlin
34e535ea7d [libbom/libcar] Build fixes for local setup
+ Include onhachoe's comments from PR.

Change-Id: Idf3d93d617cce81ecd80947f97a51057a070a0ef
2017-11-14 13:06:03 -08:00
Kellie Medlin
af27dd2bc4 [libbom/libcar] Minor fixes to BOM writer
- When new indices are added to a BOM, the extra spaces are now zero'd out instead of left as
junk memory.  The space after the index table seems to be hidden metadata about a freelist, so
having this data randomized is not good.
- Add support for inserting freelist data at the end of the index table.
- Sorted entries added to a BOM tree, which appears expected by apps searching through BOM trees.
2017-11-14 13:06:03 -08:00
Kellie Medlin
d63a2a97fe [libbom] Add dump_bom as an installable and improve the information it drops
dump_bom is super useful for inspecting the contents of .car files. I'd like to expose it officially.
2017-11-14 13:06:03 -08:00
Onha Choe
340985ebfd Fix windows lib casing
Change-Id: I7cfa47a40c37f45e9a25f943cdc0a9950b354e49
2017-10-18 23:13:21 -07:00
Onha Choe
7631a5edc0 Fix library name casing.
Change-Id: Iba57c4f57a1cc19fab164a85f2303775fbf1be08
2017-10-18 11:26:55 -07:00
Onha Choe
a0eb91056b Make xcrun to process everything after tool specification argument to the tool invocation. 2017-10-13 18:08:19 -07:00
Onha Choe
ba743cc749 Fix Windows process execution. 2017-10-13 18:08:19 -07:00
Onha Choe
ec8978dd69 Fix GetCurrentDirectroyW buffer size argument to include null byte as well. 2017-10-13 18:08:19 -07:00
Onha Choe
b8738d6893 Enable cross compilation to windows using clang. 2017-10-13 18:08:19 -07:00
Felix Krause
32b9fbeb69 Fix syntax highlighting in README 2017-06-25 18:23:45 -07:00
Grant Paul
7799360c21 Explicitly set home directory so it is available on Windows.
Windows sets `USERPROFILE` rather than `HOME` for the equivalent
directory, but many specifications and build settings reference
`HOME`.
2017-06-19 11:52:20 -07:00
Grant Paul
cad38e9204 Support Windows paths in memory-backed filesystem and tests.
Until strongly typed paths make the correct root implicit, this
adjusts the path root used in tests to match what is expected on
Windows and Unix.
2017-06-19 11:52:20 -07:00
Grant Paul
a0d686b809 Use strongly typed paths to back filesystem path utilities.
These functions are now deprecated, but using the new infrastructure
makes everything more consistent. This is also sufficient for path
support on Windows, even before adopting the strongly typed paths.
2017-06-19 11:52:20 -07:00
Grant Paul
277cad3c83 Add strongly typed representations of filesystem paths.
There are two types, one to represent any kind of path, and one
that always represents a full absolute path. Conversion between
them is checked to ensure consistency.

The path types are templated on traits, which implement platform-
specific path behavior. They default to the appropriate traits
for the current platform, but are customizable as required. The
path format consists of three parts: a root, of which there can
be one (Unix) or many (Windows), and a path, which is separated
by path separators.
2017-06-19 11:52:20 -07:00
Grant Paul
eecca45796 Disable Linenoise on Windows.
There are various forks of Linenoise with Windows support, but none
compile cleanly with all compilers. For now, just disable it.
2017-06-19 11:52:20 -07:00
Grant Paul
1e95a6bb5e Disable file permissions support on Windows.
Windows does not clearly have a sense of file permissions. For now,
just ignore calls to read and write file permissions on Windows.
2017-06-19 11:52:20 -07:00
Grant Paul
11992c4e79 Add support for memory mapping BOM files on Windows. 2017-06-19 11:52:20 -07:00
Grant Paul
a490dadd89 Update README to indicate Windows support. 2017-06-19 11:52:20 -07:00
Grant Paul
bb0c1b73d0 Add CI for Windows using AppVeyor and Travis. 2017-06-19 11:52:20 -07:00
Grant Paul
d84b57594d Disable color build output on Windows.
Windows generally does not support ANSI escape codes, currently used
for color and bold output. For now, just disable support.
2017-06-19 11:52:20 -07:00
Grant Paul
000da4f0af Add Windows support to default filesystem. 2017-06-19 11:52:20 -07:00
Grant Paul
1633cfdc78 Add Windows support for process information. 2017-06-19 11:52:20 -07:00
Grant Paul
0e1d1ed246 Add Windows support for user and group info; separate from process.
Separate from the process as it is only vaguely related and adding
unused user information to in-memory process contexts was extra code.

Windows support uses the SID as the user ID, as it matches the idea
of an identifer uniquely identifying a user or a group.
2017-06-19 11:52:20 -07:00
Grant Paul
a1f792a720 Add Windows support for launching new processes.
Windows is simpler than Unix in that it doesn't require fork just
just to set a working directory; it's more complex in that arguments
must be manually quoted rather than passed as an array.
2017-06-19 11:52:20 -07:00
Grant Paul
cc30391cde Add Windows support for XML property lists using the native XmlLite. 2017-06-19 11:52:20 -07:00
Grant Paul
50b1213eca Add Windows support for loading PNG files using GDI+. 2017-06-19 11:52:20 -07:00
Stephane Sezer
4836a9755b De-duplicate the packed struct definition 2017-06-19 11:52:20 -07:00
Grant Paul
daa326ae9f Add MSVC support for zero-length arrays and packed structs. 2017-06-19 11:52:20 -07:00
Stephane Sezer
8a433f1394 Do not use ::strcasecamp directly
Instead, we can use the wrapper in libutil so we stay
Windows-compatible.
2017-06-19 11:52:20 -07:00
Stephane Sezer
8d6d6ad606 Add a helper function to deal with strcasecmp on Windows
This function doesn't exist on Windows, but _stricmp does.
2017-06-19 11:52:20 -07:00
Grant Paul
715dcf1a01 Add MSVC support to code missing required C++ library includes. 2017-06-19 11:52:20 -07:00
Stephane Sezer
559eddfc8a Minor changes for some string.h includes 2017-06-19 11:52:20 -07:00
Grant Paul
c6f721ed4f Add Windows support to code using platform-specific headers. 2017-06-19 11:52:20 -07:00
Grant Paul
30c97af5c9 Add MSVC support to code using C99 struct initializers in C++. 2017-06-19 11:52:20 -07:00
Grant Paul
696ec87f98 Add MSVC support for two-operand ternary conditionals. 2017-06-19 11:52:20 -07:00
Grant Paul
1f6710d50a Add Windows support for byte order manipulation. 2017-06-19 11:52:20 -07:00
Grant Paul
7e2f8ab5dd Update gtest to a version with Windows support. 2017-06-19 11:52:20 -07:00
Grant Paul
7a001832a9 Add Windows, MSVC, and MinGW support to build configuration.
- Set to use static or dynamic libraries at top level.
 - Compiler configuration for MSVC and MinGW.
 - Copy rather than create symlink for aliases on Windows.
2017-06-19 11:52:20 -07:00
Onha Choe
183c087a64 Make build order respect phase ordering on build target. 2017-04-17 22:46:07 -07:00
Onha Choe
4af6ebb627 Make PlistBuddy differentiate save and print format
Check input to determine the save format, and if not found,
make XML the default save format.

Print format logic stays the same.
2017-04-14 13:28:39 -07:00
Onha Choe
37fa106537 Process child directories first in Filesystem->readDirectory call 2017-04-13 14:23:00 -07:00