-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge platform calculations into a DyninstPlatform.cmake
- Loading branch information
Showing
3 changed files
with
39 additions
and
38 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -1,5 +1,41 @@ | ||
if(UNIX) | ||
include(DyninstPlatformUnix) | ||
include_guard(GLOBAL) | ||
|
||
if(WIN32) | ||
set(PLATFORM i386-unknown-nt4.0) | ||
return() | ||
endif() | ||
|
||
set(PLATFORM $ENV{PLATFORM}) | ||
message(STATUS "-- Input platform: ${PLATFORM}") | ||
set(VALID_PLATFORMS | ||
amd64-unknown-freebsd7.2 i386-unknown-freebsd7.2 i386-unknown-linux2.4 ppc64_linux | ||
x86_64-unknown-linux2.4 aarch64-unknown-linux) | ||
|
||
if(NOT PLATFORM) | ||
set(INVALID_PLATFORM true) | ||
else() | ||
include(DyninstPlatformWindows) | ||
list(FIND VALID_PLATFORMS ${PLATFORM} PLATFORM_FOUND) | ||
if(PLATFORM_FOUND EQUAL -1) | ||
set(INVALID_PLATFORM true) | ||
endif() | ||
endif() | ||
|
||
execute_process(COMMAND ${DYNINST_ROOT}/scripts/sysname OUTPUT_VARIABLE SYSNAME_OUT) | ||
string(REPLACE "\n" "" SYSPLATFORM ${SYSNAME_OUT}) | ||
|
||
if(INVALID_PLATFORM) | ||
# Try to set it automatically | ||
execute_process(COMMAND ${DYNINST_ROOT}/scripts/dynsysname ${SYSNAME_OUT} | ||
OUTPUT_VARIABLE DYNSYSNAME_OUT) | ||
string(REPLACE "\n" "" PLATFORM ${DYNSYSNAME_OUT}) | ||
message(STATUS "-- Attempting to automatically identify platform: ${PLATFORM}") | ||
endif() | ||
|
||
list(FIND VALID_PLATFORMS ${PLATFORM} PLATFORM_FOUND) | ||
|
||
if(PLATFORM_FOUND EQUAL -1) | ||
message( | ||
FATAL_ERROR | ||
"Error: unknown platform ${PLATFORM}; please set the PLATFORM environment variable to one of the following options: ${VALID_PLATFORMS}" | ||
) | ||
endif() |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.