Skip to content

Commit

Permalink
Bugfixes for building pal from Windows using CMake
Browse files Browse the repository at this point in the history
Signed-off-by: JaredWright <[email protected]>
  • Loading branch information
JaredWright committed Mar 29, 2020
1 parent 766f1f1 commit d4471e7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ else()
endif()

add_custom_command(
COMMAND PYTHONPATH=${PYTHONPATH} ${Python3_EXECUTABLE} -m pal
COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/pal.py
-o ${PAL_OUTPUT_DIR}/pal
--arch=${PAL_TARGET_ARCH}
--language=${PAL_TARGET_LANGUAGE}
Expand Down
5 changes: 5 additions & 0 deletions PreLoad.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ninja is the only supported CMake generator on Windows
if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL Windows)
message(STATUS "Using CMake Generator: Ninja")
set(CMAKE_GENERATOR "Ninja" CACHE INTERNAL "")
endif()
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Is your software so tightly coupled to your CPU that unit testing seems impossib

The Bareflank **P**rocessor **A**bstraction **L**ayer transforms facts about your CPU into a software support library. This lets you access and manipulate the low-level details of your hardware through a convinient software API. Supose you are working on a C++ project for the Intel platform, and compiling/assembling with a GNU toolchain:

0. Install Python > 3.6 and ```pip install lxml dataclasses colorama pyyaml```
0. Install Python > 3.6, and then ```pip3 install lxml dataclasses colorama pyyaml```

1. Generate a PAL for your project:

Expand Down Expand Up @@ -61,6 +61,10 @@ cmake ../pal -DPAL_TARGET_ARCH=armv8-a -DPAL_ACCESS_MECHANISM=gas_aarch64
make
```

If you would like to build PAL using CMake on Windows, install the
[ninja](https://github.com/ninja-build/ninja/releases)
build tool first.

## Does PAL generate *everything* from the \<insert_vendor_name\> manual?
Not yet, but it does support a whole lot. Is the project missing something that you need? Help us add it! There are a few different ways you can contribute new defintions to the project:

Expand Down
2 changes: 1 addition & 1 deletion pal/parser/pal_model_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def parse_file(self, path):
if "__template__" in path:
return []

with open(path, "r") as infile:
with open(path, "r", encoding="utf8") as infile:
data = load(infile, Loader)

for item in data:
Expand Down

0 comments on commit d4471e7

Please sign in to comment.