-
Notifications
You must be signed in to change notification settings - Fork 1
CMake plumbing to build the loader (2) #14
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
Open
illwieckz
wants to merge
16
commits into
illwieckz/mingw-2
Choose a base branch
from
illwieckz/cmake
base: illwieckz/mingw-2
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
82a062b
cmake: add MinGW CMake toolchains for cross-compilation
illwieckz 1e2d0d0
cmake: add CMake scripts to build sel_ldr and nacl_helper_bootstrap
illwieckz 257f46c
cmake: use path sanitization
illwieckz ef89f09
cmake: add install target
illwieckz bfa7cb7
cmake: NUKE ZERO_BASED_SANDBOX
illwieckz d50db34
cmake: NUKE mipsel
illwieckz 05ccb01
fixup: cmake: Windows flags on MinGW too
illwieckz ecdc33b
fixup: cmake: Win time on MinGW too
illwieckz c6430fd
cmake: NUKE kernel check we will never do
illwieckz a68f22a
fixup: cmake: no GCC flags on MSVC
illwieckz 1116439
fixup: cmake: NUKE JWasm
illwieckz f5911b1
cmake: use size optimization for nacl_helper_bootstrap, with toplevel…
illwieckz b6e921f
win32: silence the warning for the unused CheckCPUFeatureDetection() …
illwieckz 0fbf3d2
cmake: add the Yokai CMake framework
illwieckz 6ac7627
trusted: add ifdef NACL_X86_64_ZERO_BASED_SANDBOX
illwieckz e9a29e4
win32: skip some CPU detection on Windows with MinGW like amd64 MSVC
illwieckz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| cmake_minimum_required(VERSION 3.12) | ||
|
|
||
| if (COMPILER_TARGET) | ||
| set(CMAKE_C_COMPILER_TARGET "${COMPILER_TARGET}") | ||
| set(CMAKE_CXX_COMPILER_TARGET "${COMPILER_TARGET}") | ||
| set(CMAKE_ASM_COMPILER_TARGET "${COMPILER_TARGET}") | ||
| endif() | ||
|
|
||
| project(native_client C CXX ASM) | ||
|
|
||
| set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}") | ||
|
|
||
| list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") | ||
|
|
||
| include(Yokai/Detection) | ||
| include(NaClFlags) | ||
|
|
||
| if (NOT CMAKE_BUILD_TYPE) | ||
| set(CMAKE_BUILD_TYPE RelWithDebInfo) | ||
| endif() | ||
|
|
||
| option(BUILD_NACL_LOADER "Build the sel_ldr program." ON) | ||
|
|
||
| if (YOKAI_TARGET_SYSTEM_LINUX_COMPATIBILITY) | ||
| option(BUILD_NACL_HELPER_BOOTSTRAP "Build the nacl_helper_bootstrap program on platforms requiring it." ON) | ||
| endif() | ||
|
|
||
| if (BUILD_NACL_LOADER AND YOKAI_TARGET_SYSTEM_WINDOWS) | ||
| option(FORCE_NO_TRUSTED_BUILD "Prevent use of trusted toolchain." OFF) | ||
| endif() | ||
|
|
||
| if (BUILD_NACL_LOADER AND YOKAI_CXX_COMPILER_MSVC) | ||
| set(REQUIRE_MASM ON) | ||
| endif() | ||
|
|
||
| if (BUILD_NACL_LOADER AND YOKAI_TARGET_SYSTEM_MACOS) | ||
| set(REQUIRE_PYTHON ON) | ||
| endif() | ||
|
|
||
| if (BUILD_NACL_HELPER_BOOTSTRAP) | ||
| set(REQUIRE_PYTHON ON) | ||
| endif() | ||
|
|
||
| if (REQUIRE_PYTHON) | ||
| if (NOT PYTHON) | ||
| find_program(PATH_PYTHON NAMES "python3" DOC "Path to the python3 executable." REQUIRED) | ||
| endif() | ||
| endif() | ||
|
|
||
| if (REQUIRE_MASM) | ||
| enable_language(ASM_MASM) | ||
| # TODO: win64_asm_env = env.Clone(ASCOM='ml64 $ASFLAGS /c /Fo$TARGET $SOURCES') | ||
| # TODO: ldr_inputs += [win64_asm_env.ComponentObject('arch/x86_64/nacl_switch_unwind_win.asm')] | ||
| endif() | ||
|
|
||
| include_directories("include-hax") | ||
|
|
||
| if (YOKAI_TARGET_ARCH_I686) | ||
| set(VALIDATOR_ARCH_SUFFIX "_x86_32") | ||
| elseif (YOKAI_TARGET_ARCH_AMD64) | ||
| set(VALIDATOR_ARCH_SUFFIX "_x86_64") | ||
| elseif (YOKAI_TARGET_ARCH_ARMHF OR YOKAI_TARGET_ARCH_ARMEL) | ||
| set(VALIDATOR_ARCH_SUFFIX "_arm") | ||
| endif() | ||
|
|
||
| if (BUILD_NACL_LOADER) | ||
| add_subdirectory(src/shared/gio) | ||
| add_subdirectory(src/shared/imc) | ||
| add_subdirectory(src/shared/platform) | ||
| add_subdirectory(src/trusted/cpu_features) | ||
| add_subdirectory(src/trusted/debug_stub) | ||
| add_subdirectory(src/trusted/desc) | ||
| add_subdirectory(src/trusted/fault_injection) | ||
| add_subdirectory(src/trusted/interval_multiset) | ||
| add_subdirectory(src/trusted/nacl_base) | ||
| add_subdirectory(src/trusted/perf_counter) | ||
| add_subdirectory(src/trusted/platform_qualify) | ||
| add_subdirectory(src/trusted/validator) | ||
|
|
||
| if (YOKAI_TARGET_ARCH_I686 OR YOKAI_TARGET_ARCH_AMD64) | ||
| add_subdirectory(src/trusted/validator_x86) | ||
| add_subdirectory(src/trusted/validator_ragel) | ||
| elseif (YOKAI_TARGET_ARCH_ARMHF OR YOKAI_TARGET_ARCH_ARMEL) | ||
| add_subdirectory(src/trusted/validator_arm) | ||
| endif() | ||
| endif() | ||
|
|
||
| if (BUILD_NACL_LOADER) | ||
| add_subdirectory(src/trusted/service_runtime) | ||
| endif() | ||
|
|
||
| if (BUILD_NACL_HELPER_BOOTSTRAP) | ||
| add_subdirectory(src/trusted/service_runtime/linux) | ||
| endif() | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem to have any relevance when the build uses only one toolchain to begin with.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.