Merge pull request #7816

29296d5 cmake: fix double build (selsta)
This commit is contained in:
luigi1111 2021-08-11 22:39:06 -04:00
commit 460fd4c80a
No known key found for this signature in database
GPG Key ID: F4ACA0183641E010
1 changed files with 17 additions and 17 deletions

View File

@ -603,6 +603,23 @@ add_definitions(-DAUTO_INITIALIZE_EASYLOGGINGPP)
set(MONERO_GENERATED_HEADERS_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated_include") set(MONERO_GENERATED_HEADERS_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated_include")
include_directories(${MONERO_GENERATED_HEADERS_DIR}) include_directories(${MONERO_GENERATED_HEADERS_DIR})
# As of OpenBSD 6.8, -march=<anything> breaks the build
function(set_default_arch)
if (OPENBSD)
set(ARCH default)
else()
set(ARCH native)
endif()
set(ARCH ${ARCH} CACHE STRING "CPU to build for: -march value or 'default' to not pass -march at all")
endfunction()
if (NOT (MSVC OR ARCH))
set_default_arch()
endif()
CHECK_C_COMPILER_FLAG(-std=c11 HAVE_C11)
option(COVERAGE "Enable profiling for test coverage report" OFF) option(COVERAGE "Enable profiling for test coverage report" OFF)
if(COVERAGE) if(COVERAGE)
message(STATUS "Building with profiling for test coverage report") message(STATUS "Building with profiling for test coverage report")
@ -682,17 +699,6 @@ endif()
# Trezor support check # Trezor support check
include(CheckTrezor) include(CheckTrezor)
# As of OpenBSD 6.8, -march=<anything> breaks the build
function(set_default_arch)
if (OPENBSD)
set(ARCH default)
else()
set(ARCH native)
endif()
set(ARCH ${ARCH} CACHE STRING "CPU to build for: -march value or 'default' to not pass -march at all")
endfunction()
if(MSVC) if(MSVC)
add_definitions("/bigobj /MP /W3 /GS- /D_CRT_SECURE_NO_WARNINGS /wd4996 /wd4345 /D_WIN32_WINNT=0x0600 /DWIN32_LEAN_AND_MEAN /DGTEST_HAS_TR1_TUPLE=0 /FIinline_c.h /D__SSE4_1__") add_definitions("/bigobj /MP /W3 /GS- /D_CRT_SECURE_NO_WARNINGS /wd4996 /wd4345 /D_WIN32_WINNT=0x0600 /DWIN32_LEAN_AND_MEAN /DGTEST_HAS_TR1_TUPLE=0 /FIinline_c.h /D__SSE4_1__")
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Dinline=__inline") # set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Dinline=__inline")
@ -705,9 +711,6 @@ if(MSVC)
include_directories(SYSTEM src/platform/msc) include_directories(SYSTEM src/platform/msc)
else() else()
include(TestCXXAcceptsFlag) include(TestCXXAcceptsFlag)
if (NOT ARCH)
set_default_arch()
endif()
message(STATUS "Building on ${CMAKE_SYSTEM_PROCESSOR} for ${ARCH}") message(STATUS "Building on ${CMAKE_SYSTEM_PROCESSOR} for ${ARCH}")
if(ARCH STREQUAL "default") if(ARCH STREQUAL "default")
set(ARCH_FLAG "") set(ARCH_FLAG "")
@ -1243,9 +1246,6 @@ option(BUILD_GUI_DEPS "Build GUI dependencies." OFF)
# on libunbound shipped with their distribution instead # on libunbound shipped with their distribution instead
option(INSTALL_VENDORED_LIBUNBOUND "Install libunbound binary built from source vendored with this repo." OFF) option(INSTALL_VENDORED_LIBUNBOUND "Install libunbound binary built from source vendored with this repo." OFF)
CHECK_C_COMPILER_FLAG(-std=c11 HAVE_C11)
find_package(PythonInterp) find_package(PythonInterp)
find_program(iwyu_tool_path NAMES iwyu_tool.py iwyu_tool) find_program(iwyu_tool_path NAMES iwyu_tool.py iwyu_tool)
if (iwyu_tool_path AND PYTHONINTERP_FOUND) if (iwyu_tool_path AND PYTHONINTERP_FOUND)