-march=native breaks compilation on powerpc64 and we shouldn't optimize anyway for the CPU in the build cluster. PR: 238886 Approved by: yuri (maintainer), tcberner (mentor) Differential Revision: https://reviews.freebsd.org/D20806
52 lines
2 KiB
Text
52 lines
2 KiB
Text
--- CMakeLists.txt.orig 2019-04-04 06:38:39 UTC
|
|
+++ CMakeLists.txt
|
|
@@ -20,6 +20,8 @@ include(GNUInstallDirs)
|
|
project(leelaz)
|
|
add_subdirectory(gtest EXCLUDE_FROM_ALL) # We don't want to install gtest, exclude it from `all`
|
|
|
|
+link_directories(${CMAKE_INSTALL_PREFIX}/lib)
|
|
+
|
|
# Required Packages
|
|
set(Boost_MIN_VERSION "1.58.0")
|
|
set(Boost_USE_MULTITHREADED ON)
|
|
@@ -70,13 +72,13 @@ if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_T
|
|
endif(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
|
|
|
|
if(GccSpecificFlags)
|
|
- set(GCC_COMPILE_FLAGS "-Wall -Wextra -ffast-math -flto -march=native")
|
|
+ set(GCC_COMPILE_FLAGS "-Wall -Wextra -ffast-math") # https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=238514
|
|
set(GCC_DISABLED_WARNING_COMPILE_FLAGS "-Wno-ignored-attributes -Wno-maybe-uninitialized \
|
|
-Wno-mismatched-tags")
|
|
set(GCC_FLAGS "${GCC_COMPILE_FLAGS} ${GCC_DISABLED_WARNING_COMPILE_FLAGS}")
|
|
set(CMAKE_CXX_FLAGS_DEBUG "${GCC_FLAGS} -g -Og")
|
|
set(CMAKE_CXX_FLAGS_RELEASE "${GCC_FLAGS} -g -O3 -DNDEBUG")
|
|
- set(CMAKE_EXE_LINKER_FLAGS "-flto -g")
|
|
+ set(CMAKE_EXE_LINKER_FLAGS "-g") # https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=238514
|
|
endif(GccSpecificFlags)
|
|
|
|
if(USE_CPU_ONLY)
|
|
@@ -86,7 +88,7 @@ if(USE_HALF)
|
|
add_definitions(-DUSE_HALF)
|
|
endif()
|
|
|
|
-set(IncludePath "${CMAKE_CURRENT_SOURCE_DIR}/src" "${CMAKE_CURRENT_SOURCE_DIR}/src/Eigen")
|
|
+set(IncludePath "${CMAKE_CURRENT_SOURCE_DIR}/src" "${CMAKE_INSTALL_PREFIX}/include/eigen3")
|
|
set(SrcPath "${CMAKE_CURRENT_SOURCE_DIR}/src")
|
|
|
|
include_directories(${IncludePath})
|
|
@@ -130,6 +132,7 @@ else()
|
|
endif()
|
|
|
|
# Google Test below
|
|
+if (BUILD_TESTING)
|
|
file(GLOB tests_SRC "${SrcPath}/tests/*.cpp")
|
|
|
|
add_executable(tests ${tests_SRC} $<TARGET_OBJECTS:objs>)
|
|
@@ -142,6 +145,7 @@ target_link_libraries(tests ${BLAS_LIBRARIES})
|
|
target_link_libraries(tests ${OpenCL_LIBRARIES})
|
|
target_link_libraries(tests ${ZLIB_LIBRARIES})
|
|
target_link_libraries(tests gtest_main ${CMAKE_THREAD_LIBS_INIT})
|
|
+endif(BUILD_TESTING)
|
|
|
|
include(GetGitRevisionDescription)
|
|
git_describe(VERSION --tags)
|