aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@google.com>2023-02-27 12:46:12 -0500
committerBoringssl LUCI CQ <boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-02-27 18:10:21 +0000
commit8c4ec3b7b0d69649c04778a39eed5cdca338c1c0 (patch)
treec2c4557b486d8495398af246b0cb816c776545a3 /CMakeLists.txt
parent1b666ddc2018611083cc19c84c2768f6156320be (diff)
downloadboringssl-8c4ec3b7b0d69649c04778a39eed5cdca338c1c0.zip
boringssl-8c4ec3b7b0d69649c04778a39eed5cdca338c1c0.tar.gz
boringssl-8c4ec3b7b0d69649c04778a39eed5cdca338c1c0.tar.bz2
Replace almost all instances of CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR
If another project includes us as a subproject, as gRPC does, CMAKE_SOURCE_DIR points to the top-level source directory, not ours. PROJECT_SOURCE_DIR points to ours. Likewise, CMAKE_BINARY_DIR will point to the top-level one. gRPC doesn't consume this CMake build, but in preparation for eventually unifying the two CMake builds, replace CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR with a combination of CMAKE_CURRENT_{SOURCE,BINARY}_DIR and PROJECT_SOURCE_DIR. There's one more CMAKE_SOURCE_DIR which controls some default install directory. I've left that one alone for now as I'm not sure what to do with it. Probably the answer is to, like in gRPC, disable the install target by default when we're not the top-level source directory. Bug: 542 Change-Id: Iea26bbef8a4637671fd0e7476101512e871e7e18 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/57686 Reviewed-by: Bob Beck <bbe@google.com> Commit-Queue: David Benjamin <davidben@google.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt16
1 files changed, 8 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a66a37f..23154a2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -475,7 +475,7 @@ if(USE_CUSTOM_LIBCXX)
CXX_STANDARD_REQUIRED TRUE
)
# libc++abi depends on libc++ internal headers.
- set_property(TARGET libcxx libcxxabi APPEND PROPERTY INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR}/util/bot/libcxx/src")
+ set_property(TARGET libcxx libcxxabi APPEND PROPERTY INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/util/bot/libcxx/src")
target_link_libraries(libcxx libcxxabi)
endif()
@@ -551,16 +551,16 @@ endif()
if(FIPS)
add_custom_target(
acvp_tests
- COMMAND ${GO_EXECUTABLE} build -o ${CMAKE_BINARY_DIR}/acvptool
+ COMMAND ${GO_EXECUTABLE} build -o ${CMAKE_CURRENT_BINARY_DIR}/acvptool
boringssl.googlesource.com/boringssl/util/fipstools/acvp/acvptool
- COMMAND ${GO_EXECUTABLE} build -o ${CMAKE_BINARY_DIR}/testmodulewrapper
+ COMMAND ${GO_EXECUTABLE} build -o ${CMAKE_CURRENT_BINARY_DIR}/testmodulewrapper
boringssl.googlesource.com/boringssl/util/fipstools/acvp/acvptool/testmodulewrapper
COMMAND cd util/fipstools/acvp/acvptool/test &&
${GO_EXECUTABLE} run check_expected.go
- -tool ${CMAKE_BINARY_DIR}/acvptool
- -module-wrappers modulewrapper:$<TARGET_FILE:modulewrapper>,testmodulewrapper:${CMAKE_BINARY_DIR}/testmodulewrapper
+ -tool ${CMAKE_CURRENT_BINARY_DIR}/acvptool
+ -module-wrappers modulewrapper:$<TARGET_FILE:modulewrapper>,testmodulewrapper:${CMAKE_CURRENT_BINARY_DIR}/testmodulewrapper
-tests tests.json
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS modulewrapper
USES_TERMINAL)
@@ -582,12 +582,12 @@ set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS
add_custom_target(
run_tests
COMMAND ${GO_EXECUTABLE} run util/all_tests.go -build-dir
- ${CMAKE_BINARY_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}
COMMAND cd ssl/test/runner &&
${GO_EXECUTABLE} test -shim-path $<TARGET_FILE:bssl_shim>
${HANDSHAKER_ARGS} ${RUNNER_ARGS}
COMMAND ${GO_EXECUTABLE} test ${GO_TESTS}
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS all_tests bssl_shim handshaker fips_specific_tests_if_any
USES_TERMINAL)