-
Notifications
You must be signed in to change notification settings - Fork 769
[XPTIFW] Enable in-tree builds #2849
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,12 @@ endif() | |
|
||
project (xptifw) | ||
|
||
foreach(flag_var | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since my machine died, I have not been able to reproduce the Windows build failures. To be a part of LLVM builds, the Debug libraries must be of the format xxxxd.dll or they will overwrite the release version and vice-versa and they are not ABI compatible on Windows. The logic that is there in 'xpti' may be needed here to ensure that happens, especially when invoked by LLVM builds as the binaries may be placed in the same directory. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This piece of code changes static MSVC CRT to Dynamic. So, if there's a |
||
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE | ||
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) | ||
string(REGEX REPLACE "/MT" "/MD" ${flag_var} "${${flag_var}}") | ||
endforeach() | ||
|
||
set(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/lib/${CMAKE_BUILD_TYPE}) | ||
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}) | ||
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,36 +3,39 @@ if (NOT EXISTS ${XPTI_SOURCE_DIR}) | |
endif() | ||
include_directories(${XPTI_SOURCE_DIR}/include) | ||
|
||
# Download and unpack googletest at configure time | ||
configure_file(../CMakeLists.txt.in googletest-download/CMakeLists.txt) | ||
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . | ||
RESULT_VARIABLE result | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download ) | ||
if(result) | ||
message(FATAL_ERROR "CMake step for googletest failed: ${result}") | ||
endif() | ||
execute_process(COMMAND ${CMAKE_COMMAND} --build . | ||
RESULT_VARIABLE result | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download ) | ||
if(result) | ||
message(FATAL_ERROR "Build step for googletest failed: ${result}") | ||
endif() | ||
# Only download Google Test outside of LLVM tree. | ||
if (NOT DEFINED LLVM_EXTERNAL_XPTIFW_SOURCE_DIR) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was a simple enough change :) - looks good. |
||
# Download and unpack googletest at configure time | ||
configure_file(../CMakeLists.txt.in googletest-download/CMakeLists.txt) | ||
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . | ||
RESULT_VARIABLE result | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download ) | ||
if(result) | ||
message(FATAL_ERROR "CMake step for googletest failed: ${result}") | ||
endif() | ||
execute_process(COMMAND ${CMAKE_COMMAND} --build . | ||
RESULT_VARIABLE result | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download ) | ||
if(result) | ||
message(FATAL_ERROR "Build step for googletest failed: ${result}") | ||
endif() | ||
|
||
# Prevent overriding the parent project's compiler/linker | ||
# settings on Windows | ||
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) | ||
# Prevent overriding the parent project's compiler/linker | ||
# settings on Windows | ||
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) | ||
|
||
# Add googletest directly to our build. This defines | ||
# the gtest and gtest_main targets. | ||
add_subdirectory(${CMAKE_CURRENT_BINARY_DIR}/googletest-src | ||
${CMAKE_CURRENT_BINARY_DIR}/googletest-build | ||
EXCLUDE_FROM_ALL) | ||
# Add googletest directly to our build. This defines | ||
# the gtest and gtest_main targets. | ||
add_subdirectory(${CMAKE_CURRENT_BINARY_DIR}/googletest-src | ||
${CMAKE_CURRENT_BINARY_DIR}/googletest-build | ||
EXCLUDE_FROM_ALL) | ||
|
||
# The gtest/gtest_main targets carry header search path | ||
# dependencies automatically when using CMake 2.8.11 or | ||
# later. Otherwise we have to add them here ourselves. | ||
if (CMAKE_VERSION VERSION_LESS 2.8.11) | ||
include_directories("${gtest_SOURCE_DIR}/include") | ||
# The gtest/gtest_main targets carry header search path | ||
# dependencies automatically when using CMake 2.8.11 or | ||
# later. Otherwise we have to add them here ourselves. | ||
if (CMAKE_VERSION VERSION_LESS 2.8.11) | ||
include_directories("${gtest_SOURCE_DIR}/include") | ||
endif() | ||
endif() | ||
|
||
# Now simply link against gtest or gtest_main as needed. Eg | ||
|
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.
Previous builds used "-DLLVM_EXTERNAL_XPTI_SOURCE_DIR=$SYCL_HOME/xpti" variable to enable 'xpti' in LLVM. I see two variables now "LLVM_EXTERNAL_XPTI_SOURCE_DIR" and "XPTI_SOURCE_DIR" - is there a reason the second one was added? It might affect scripts people may have already created.
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.
LLVM_EXTERNAL_XPTI_SOURCE_DIR
tells LLVM where to findxpti
external project, so that it could load it. It is required, because LLVM is a monorepo of multiple projects, and LLVM needs to somehow know where to find non-standard sub-projects. It shouldn't affect other scripts.