Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: Add AMICI_CXX_OPTIONS #1664

Merged
merged 5 commits into from
Feb 8, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
endif()
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(ENABLE_SWIG ON)

# Compiler flags
include(CheckCXXCompilerFlag)
Expand Down Expand Up @@ -177,6 +176,8 @@ if(ENABLE_HDF5)
endif()

add_library(${PROJECT_NAME} ${AMICI_SRC_LIST})
set(AMICI_CXX_OPTIONS "" CACHE STRING "C++ options for libamici (semicolon-separated)")
target_compile_options(${PROJECT_NAME} PRIVATE "${AMICI_CXX_OPTIONS}")
add_dependencies(${PROJECT_NAME} version)
file(GLOB PUBLIC_HEADERS include/amici/*.h)
set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${PUBLIC_HEADERS}")
Expand Down
2 changes: 1 addition & 1 deletion scripts/buildAmici.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ else
fi

${cmake} \
-DCMAKE_CXX_FLAGS="-Wall -Wextra -Werror" \
-DAMICI_CXX_OPTIONS="-Wall;-Wextra;-Werror" \
-DCMAKE_BUILD_TYPE=$build_type \
-DPython3_EXECUTABLE="$(command -v python3)" ..

Expand Down