Skip to content
Snippets Groups Projects
Commit fcb285e0 authored by Daniel Vonk's avatar Daniel Vonk Committed by Daniel Vonk
Browse files

Generate SassenaConfig.h only once

parent 0bffda37
Branches fix-ci
No related tags found
2 merge requests!19Merge develop into main,!13Add CI System to Sassena and Modernize Build-System
......@@ -23,11 +23,41 @@ if(SASS_ENABLE_SANITIZERS)
endif()
endif()
# Add the "-Werror" compiler flag to the specified target
function(add_werror target)
if(NOT MSVC)
target_compile_options(${target} PRIVATE -Werror -Wno-error=deprecated-declarations -Wundef)
check_cxx_compiler_flag("-Werror -Wsuggest-override" CXX_SUPPORTS_SUGGEST_OVERRIDE)
if(CXX_SUPPORTS_SUGGEST_OVERRIDE)
target_compile_options(${target} PRIVATE "-Wsuggest-override")
endif()
# If we call directly -Wimplicit-fallthrough it's use it as a error ! not a warning
# we need to tell gcc that we can't want to manage it as error
# If code is ok we need to add [[fallthrough]]; before code
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
target_compile_options(${target} PRIVATE -Wno-error=implicit-fallthrough -Wimplicit-fallthrough)
endif()
endif()
endfunction()
if(SASS_USE_WERROR)
add_werror(SassenaCore)
add_werror(sassena)
endif()
if (SASS_BUILD_DOCS)
add_subdirectory(docs)
endif()
include(ExternalProject)
include(FeatureSummary)
include(GenerateExportHeader)
include(GNUInstallDirs)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
configure_file(cmake/SassenaConfig.hpp.cmake ${CMAKE_CURRENT_BINARY_DIR}/generated/SassenaConfig.hpp @ONLY)
if(USE_DEVELOPER_MODE)
find_package(Doxygen)
set_package_properties(
......
File moved
configure_file(
"SassenaConfig.hpp.cmake"
"SassenaConfig.hpp" @ONLY
)
set(sassena_SRCS
s_stage.cpp
sassena.cpp
s_maketnx.cpp
)
set(common_SRCS
common.hpp
common.cpp
)
add_executable(sassena
sassena.cpp
${common_SRCS}
)
add_executable(s_stage
s_stage.cpp
${common_SRCS}
)
add_executable(s_maketnx
s_maketnx.cpp
${common_SRCS}
)
# ADD_EXECUTABLE(unit_broadcast
# src/common.cpp
# tests/unit_broadcast.cpp
# )
target_link_libraries (sassena
PRIVATE
SassenaCore
......@@ -54,5 +28,4 @@ TARGET_LINK_LIBRARIES (s_stage
SassenaCore
)
install(TARGETS sassena s_maketnx s_stage)
if(CRAY)
set(CMAKE_CXX_COMPILER /opt/cray/xt-asyncpe/3.7/bin/CC)
message(STATUS "Cray is chosen.")
......@@ -126,6 +125,7 @@ target_include_directories(
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/sample>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/stager>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/scatter_devices>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/generated>
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/math
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment