mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix incorrectly CMAKE_BINARY_DIR usage
Similiar to CMAKE_SOURCE_DIR. Using CMAKE_BINARY_DIR will put the generated header (stdlib.h) in build/include/solidity/libstdlib but it should start with build/third-party/solidity or the library can't find the header. Signed-off-by: Jun Zhang <jun@junz.org>
This commit is contained in:
parent
74a38fc3d8
commit
8c5ecd1c01
@ -2,7 +2,7 @@ include(FetchContent)
|
|||||||
|
|
||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
fmtlib
|
fmtlib
|
||||||
PREFIX "${CMAKE_BINARY_DIR}/deps"
|
PREFIX "${PROJECT_BINARY_DIR}/deps"
|
||||||
DOWNLOAD_DIR "${PROJECT_SOURCE_DIR}/deps/downloads"
|
DOWNLOAD_DIR "${PROJECT_SOURCE_DIR}/deps/downloads"
|
||||||
DOWNLOAD_NAME fmt-8.0.1.tar.gz
|
DOWNLOAD_NAME fmt-8.0.1.tar.gz
|
||||||
URL https://github.com/fmtlib/fmt/archive/8.0.1.tar.gz
|
URL https://github.com/fmtlib/fmt/archive/8.0.1.tar.gz
|
||||||
|
@ -6,7 +6,7 @@ else()
|
|||||||
set(JSONCPP_CMAKE_COMMAND ${CMAKE_COMMAND})
|
set(JSONCPP_CMAKE_COMMAND ${CMAKE_COMMAND})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(prefix "${CMAKE_BINARY_DIR}/deps")
|
set(prefix "${PROJECT_BINARY_DIR}/deps")
|
||||||
set(JSONCPP_LIBRARY "${prefix}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}jsoncpp${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
set(JSONCPP_LIBRARY "${prefix}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}jsoncpp${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||||
set(JSONCPP_INCLUDE_DIR "${prefix}/include")
|
set(JSONCPP_INCLUDE_DIR "${prefix}/include")
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ else()
|
|||||||
set(RANGE_V3_CMAKE_COMMAND ${CMAKE_COMMAND})
|
set(RANGE_V3_CMAKE_COMMAND ${CMAKE_COMMAND})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(prefix "${CMAKE_BINARY_DIR}/deps")
|
set(prefix "${PROJECT_BINARY_DIR}/deps")
|
||||||
set(RANGE_V3_INCLUDE_DIR "${prefix}/include")
|
set(RANGE_V3_INCLUDE_DIR "${prefix}/include")
|
||||||
|
|
||||||
ExternalProject_Add(range-v3-project
|
ExternalProject_Add(range-v3-project
|
||||||
|
@ -11,8 +11,8 @@ foreach(src IN LISTS STDLIB)
|
|||||||
string(REGEX REPLACE ";" ",\n\t0x" STDLIB_FILE_CONTENT "${STDLIB_FILE_CONTENT}")
|
string(REGEX REPLACE ";" ",\n\t0x" STDLIB_FILE_CONTENT "${STDLIB_FILE_CONTENT}")
|
||||||
set(STDLIB_FILE_CONTENT "0x${STDLIB_FILE_CONTENT}")
|
set(STDLIB_FILE_CONTENT "0x${STDLIB_FILE_CONTENT}")
|
||||||
set(STDLIB_FILE_NAME ${src})
|
set(STDLIB_FILE_NAME ${src})
|
||||||
configure_file("${PROJECT_SOURCE_DIR}/libstdlib/stdlib.src.h.in" ${CMAKE_BINARY_DIR}/include/libstdlib/${src}.h NEWLINE_STYLE LF @ONLY)
|
configure_file("${PROJECT_SOURCE_DIR}/libstdlib/stdlib.src.h.in" ${PROJECT_BINARY_DIR}/include/libstdlib/${src}.h NEWLINE_STYLE LF @ONLY)
|
||||||
list(APPEND GENERATED_STDLIB_HEADERS ${CMAKE_BINARY_DIR}/include/libstdlib/${src}.h)
|
list(APPEND GENERATED_STDLIB_HEADERS ${PROJECT_BINARY_DIR}/include/libstdlib/${src}.h)
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
configure_file("${PROJECT_SOURCE_DIR}/libstdlib/stdlib.h.in" ${CMAKE_BINARY_DIR}/include/libstdlib/stdlib.h NEWLINE_STYLE LF @ONLY)
|
configure_file("${PROJECT_SOURCE_DIR}/libstdlib/stdlib.h.in" ${PROJECT_BINARY_DIR}/include/libstdlib/stdlib.h NEWLINE_STYLE LF @ONLY)
|
||||||
|
Loading…
Reference in New Issue
Block a user