-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Share unix getexepath() definition via src/native (#44999)
* Share unix getexepath() definition via src/native * Address CR feedback * Remove duplicate property * Inline variable with single usage * Fix include path in tests * Remove unixcoreruncommon static lib dependency * Merge coreruncommon.{cpp,h} into corerun.cpp * Include local headers before the first use * Remove Unix case from (Win32 only) corerun * Use realpath in getauxval case * Delete obsolete comment
- Loading branch information
Showing
31 changed files
with
597 additions
and
985 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
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
get_filename_component(CLR_REPO_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}/../.. ABSOLUTE) | ||
set(CLR_ENG_NATIVE_DIR ${CMAKE_CURRENT_LIST_DIR}) | ||
get_filename_component(CLR_SRC_NATIVE_DIR ${CMAKE_CURRENT_LIST_DIR}/../../src/native ABSOLUTE) | ||
|
||
# TO_NATIVE_PATH so it uses backslashes in Windows to avoid getting error, | ||
# as CLR_SRC_NATIVE_DIR is used to specify source files. | ||
file (TO_NATIVE_PATH ${CLR_SRC_NATIVE_DIR} CLR_SRC_NATIVE_DIR) |
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
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
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
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
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,38 +1,21 @@ | ||
project(CoreRun) | ||
|
||
set(CMAKE_INCLUDE_CURRENT_DIR ON) | ||
|
||
set(CoreRun_SOURCES corerun.cpp logger.cpp) | ||
set(CoreRun_RESOURCES native.rc) | ||
|
||
add_definitions(-DFX_VER_INTERNALNAME_STR=CoreRun.exe) | ||
|
||
if(CLR_CMAKE_HOST_UNIX) | ||
# This does not compile on Linux yet | ||
if(CAN_BE_COMPILED_ON_LINUX) | ||
_add_executable(CoreRun | ||
${CoreRun_SOURCES} | ||
${CoreRun_RESOURCES} | ||
) | ||
endif(CAN_BE_COMPILED_ON_LINUX) | ||
|
||
else() | ||
_add_executable(CoreRun | ||
${CoreRun_SOURCES} | ||
${CoreRun_RESOURCES} | ||
) | ||
|
||
target_link_libraries(CoreRun | ||
utilcodestaticnohost | ||
advapi32.lib | ||
oleaut32.lib | ||
uuid.lib | ||
user32.lib | ||
${STATIC_MT_CRT_LIB} | ||
${STATIC_MT_VCRT_LIB} | ||
) | ||
|
||
# Can't compile on linux yet so only add for windows | ||
install_clr(TARGETS CoreRun) | ||
|
||
endif(CLR_CMAKE_HOST_UNIX) | ||
_add_executable(CoreRun | ||
corerun.cpp logger.cpp | ||
native.rc | ||
) | ||
|
||
target_link_libraries(CoreRun | ||
utilcodestaticnohost | ||
advapi32.lib | ||
oleaut32.lib | ||
uuid.lib | ||
user32.lib | ||
${STATIC_MT_CRT_LIB} | ||
${STATIC_MT_VCRT_LIB} | ||
) | ||
|
||
install_clr(TARGETS CoreRun) |
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,33 +1,17 @@ | ||
project(unixcorerun) | ||
|
||
include_directories(../unixcoreruncommon) | ||
include_directories("${CLR_SRC_NATIVE_DIR}/common") | ||
include(configure.cmake) | ||
|
||
set(CORERUN_SOURCES | ||
corerun.cpp | ||
) | ||
set(CMAKE_INCLUDE_CURRENT_DIR ON) | ||
|
||
_add_executable(corerun | ||
${CORERUN_SOURCES} | ||
) | ||
_add_executable(corerun corerun.cpp) | ||
|
||
# FreeBSD and NetBSD implement dlopen(3) in libc | ||
if(NOT CLR_CMAKE_TARGET_FREEBSD AND NOT CLR_CMAKE_TARGET_NETBSD) | ||
target_link_libraries(corerun | ||
dl | ||
) | ||
endif(NOT CLR_CMAKE_TARGET_FREEBSD AND NOT CLR_CMAKE_TARGET_NETBSD) | ||
|
||
# Libc turns locks into no-ops if pthread was not loaded into process yet. Loading | ||
# pthread by the process executable ensures that all locks are initialized properly. | ||
target_link_libraries(corerun | ||
unixcoreruncommon | ||
) | ||
target_link_libraries(corerun ${CMAKE_DL_LIBS}) | ||
|
||
# Android implements pthread natively | ||
if(NOT CLR_CMAKE_TARGET_ANDROID) | ||
target_link_libraries(corerun | ||
pthread | ||
) | ||
target_link_libraries(corerun pthread) | ||
endif() | ||
|
||
install_clr(TARGETS corerun) |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.