summaryrefslogtreecommitdiff
path: root/functions.cmake
diff options
context:
space:
mode:
authorVictor "Nate" Graf <nategraf1@gmail.com>2017-12-20 18:07:52 -0800
committerGitHub <noreply@github.com>2017-12-20 18:07:52 -0800
commit7524d72d4f0f634fe5407280b83c25181dc8c556 (patch)
tree119c7edbbd7b3a0aec47d55334d52d1471e3a3da /functions.cmake
parent9891c8ba8f84ff646455b4493447295c591665f4 (diff)
downloadcoreclr-7524d72d4f0f634fe5407280b83c25181dc8c556.tar.gz
coreclr-7524d72d4f0f634fe5407280b83c25181dc8c556.tar.bz2
coreclr-7524d72d4f0f634fe5407280b83c25181dc8c556.zip
Enable EventPipe across Unix and Windows (#14772)
* [squashed] most work complete to enable EventPipe on Windows * Eventpipe now builds on Windows * Ensure evevntpipe is intialized on Windows * Resolve the location of python from build.cmd * Ensure eventing files are generated when needed * moving linkage declaration to cmake * create new event from constructor * enable FEATURE_EVENT_TRACE and FEATURE_PERF_TRACE everywhere * [WIP] checkpoint in fixing contarct errors * add another possible python location * Fix double delete bug in EventPipeConfiguration destructor * Fix typo in function name * Revert changes to .gitgnore * bump to netstandard1.6 in preperation for new version of TraceEvent * Revert changes to groovy files * revert changes to perf-prep scripts * add common.h and use nothrow * Fix issue which was causing double delete of configprovider * Add new test utilizing TraceEvent * Remove accidentally added local directory reference * Add comment to explain the addition of misc/tracepointprovider.cpp * Add back sys.exit(0) and refactor * Change conditional to be more direct * Better handle NULL config * Initialize m_deleteDefered * Eliminate obsolete field * Fix spelling error * Fix nits * Make smaple progiler timing functions easier to read * Move projects back to netstandard1.4 * Incomplete improvements to EventPipeTrace test * Add event integrity checks to test * Clean up some left over code * Add EventSource based test * Remove unused PAL tests on Windows * Fix Linux build breaks * Minor changes to CMake files * Remove //HACK for hack that was previously removed * Fix formatting and negate a #ifdef * Add conditional to ensure PERFTRACING is not enabled without EVENT_TRACE * Take lock on EventPipeProvider and EventPipeConfiguration destruction * Load winmm.dll at runtime * Change function name and compile conditions * Move typedef into #ifndef * Use the correct config in setup * Change lifecycle managment of EventPipeConfiguration's configuration provider * Enable EventPipe tests pri0 and disable broken tests * Replace python3 only error with python2 compatable one * Make common.csproj build pri0 * Change TraceEvent version to 2.0.2 to match published verison * Address cross build failure * Remove use of undefined variable * Add crossgen fix to .cmd * Use more specific types to avoid marshalling errors * Use Assert-style statements and remove one check * Fix cross arch build * Fix flipped branch * Bring build.cmd changes to build.sh * Fix cmake writing * Revert "Bring build.cmd changes to build.sh" This reverts commit 893c6492548d8bc9859ebba5b1b810aa630fac63. * remove stdlib.h * Fix out of order null check
Diffstat (limited to 'functions.cmake')
-rw-r--r--functions.cmake68
1 files changed, 33 insertions, 35 deletions
diff --git a/functions.cmake b/functions.cmake
index 15d0cd929c..c2286839dd 100644
--- a/functions.cmake
+++ b/functions.cmake
@@ -44,11 +44,11 @@ endfunction(get_include_directories)
# Build a list of include directories for consumption by the assembler
function(get_include_directories_asm IncludeDirectories)
get_directory_property(dirs INCLUDE_DIRECTORIES)
-
+
if (CLR_CMAKE_PLATFORM_ARCH_ARM AND WIN32)
list(APPEND INC_DIRECTORIES "-I ")
endif()
-
+
foreach(dir IN LISTS dirs)
if (CLR_CMAKE_PLATFORM_ARCH_ARM AND WIN32)
list(APPEND INC_DIRECTORIES ${dir};)
@@ -141,7 +141,7 @@ function(strip_symbols targetName outputFilename)
add_custom_command(
TARGET ${targetName}
POST_BUILD
- VERBATIM
+ VERBATIM
COMMAND ${DSYMUTIL} --flat --minimize ${strip_source_file}
COMMAND ${STRIP} -S ${strip_source_file}
COMMENT Stripping symbols from ${strip_source_file} into file ${strip_destination_file}
@@ -152,7 +152,7 @@ function(strip_symbols targetName outputFilename)
add_custom_command(
TARGET ${targetName}
POST_BUILD
- VERBATIM
+ VERBATIM
COMMAND ${OBJCOPY} --only-keep-debug ${strip_source_file} ${strip_destination_file}
COMMAND ${OBJCOPY} --strip-debug ${strip_source_file}
COMMAND ${OBJCOPY} --add-gnu-debuglink=${strip_destination_file} ${strip_source_file}
@@ -166,30 +166,30 @@ function(strip_symbols targetName outputFilename)
endfunction()
function(install_clr targetName)
- list(FIND CLR_CROSS_COMPONENTS_LIST ${targetName} INDEX)
- if (NOT DEFINED CLR_CROSS_COMPONENTS_LIST OR NOT ${INDEX} EQUAL -1)
- strip_symbols(${targetName} strip_destination_file)
- # On the older version of cmake (2.8.12) used on Ubuntu 14.04 the TARGET_FILE
- # generator expression doesn't work correctly returning the wrong path and on
- # the newer cmake versions the LOCATION property isn't supported anymore.
- if(CMAKE_VERSION VERSION_EQUAL 3.0 OR CMAKE_VERSION VERSION_GREATER 3.0)
- set(install_source_file $<TARGET_FILE:${targetName}>)
- else()
- get_property(install_source_file TARGET ${targetName} PROPERTY LOCATION)
- endif()
-
- install(PROGRAMS ${install_source_file} DESTINATION .)
- if(WIN32)
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/${targetName}.pdb DESTINATION PDB)
- else()
- install(FILES ${strip_destination_file} DESTINATION .)
- endif()
+ list(FIND CLR_CROSS_COMPONENTS_LIST ${targetName} INDEX)
+ if (NOT DEFINED CLR_CROSS_COMPONENTS_LIST OR NOT ${INDEX} EQUAL -1)
+ strip_symbols(${targetName} strip_destination_file)
+ # On the older version of cmake (2.8.12) used on Ubuntu 14.04 the TARGET_FILE
+ # generator expression doesn't work correctly returning the wrong path and on
+ # the newer cmake versions the LOCATION property isn't supported anymore.
+ if(CMAKE_VERSION VERSION_EQUAL 3.0 OR CMAKE_VERSION VERSION_GREATER 3.0)
+ set(install_source_file $<TARGET_FILE:${targetName}>)
+ else()
+ get_property(install_source_file TARGET ${targetName} PROPERTY LOCATION)
+ endif()
+
+ install(PROGRAMS ${install_source_file} DESTINATION .)
+ if(WIN32)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/${targetName}.pdb DESTINATION PDB)
+ else()
+ install(FILES ${strip_destination_file} DESTINATION .)
+ endif()
if(CLR_CMAKE_PGO_INSTRUMENT)
if(WIN32)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/${targetName}.pgd DESTINATION PGD OPTIONAL)
endif()
endif()
- endif()
+ endif()
endfunction()
# Disable PAX mprotect that would prevent JIT and other codegen in coreclr from working.
@@ -217,11 +217,11 @@ function(_add_executable)
else()
add_executable(${ARGV})
endif(NOT WIN32)
- list(FIND CLR_CROSS_COMPONENTS_LIST ${ARGV0} INDEX)
- if (DEFINED CLR_CROSS_COMPONENTS_LIST AND ${INDEX} EQUAL -1)
- set_target_properties(${ARGV0} PROPERTIES EXCLUDE_FROM_ALL 1)
+ list(FIND CLR_CROSS_COMPONENTS_LIST ${ARGV0} INDEX)
+ if (DEFINED CLR_CROSS_COMPONENTS_LIST AND ${INDEX} EQUAL -1)
+ set_target_properties(${ARGV0} PROPERTIES EXCLUDE_FROM_ALL 1)
endif()
-endfunction()
+endfunction()
function(_add_library)
if(NOT WIN32)
@@ -229,10 +229,10 @@ function(_add_library)
else()
add_library(${ARGV})
endif(NOT WIN32)
- list(FIND CLR_CROSS_COMPONENTS_LIST ${ARGV0} INDEX)
- if (DEFINED CLR_CROSS_COMPONENTS_LIST AND ${INDEX} EQUAL -1)
- set_target_properties(${ARGV0} PROPERTIES EXCLUDE_FROM_ALL 1)
- endif()
+ list(FIND CLR_CROSS_COMPONENTS_LIST ${ARGV0} INDEX)
+ if (DEFINED CLR_CROSS_COMPONENTS_LIST AND ${INDEX} EQUAL -1)
+ set_target_properties(${ARGV0} PROPERTIES EXCLUDE_FROM_ALL 1)
+ endif()
endfunction()
function(_install)
@@ -263,8 +263,8 @@ function(verify_dependencies targetName errorMessage)
TARGET ${targetName}
POST_BUILD
VERBATIM
- COMMAND ${CMAKE_SOURCE_DIR}/verify-so.sh
- $<TARGET_FILE:${targetName}>
+ COMMAND ${CMAKE_SOURCE_DIR}/verify-so.sh
+ $<TARGET_FILE:${targetName}>
${errorMessage}
COMMENT "Verifying ${targetName} dependencies"
)
@@ -273,10 +273,8 @@ endfunction()
function(add_library_clr)
_add_library(${ARGV})
- add_dependencies(${ARGV0} GeneratedEventingFiles)
endfunction()
function(add_executable_clr)
_add_executable(${ARGV})
- add_dependencies(${ARGV0} GeneratedEventingFiles)
endfunction()