diff --git a/CMakeLists.txt b/CMakeLists.txt index 197a7f65b2..423b156773 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) @@ -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}") diff --git a/scripts/buildAmici.sh b/scripts/buildAmici.sh index 735e05fd3b..2d40d3cb08 100755 --- a/scripts/buildAmici.sh +++ b/scripts/buildAmici.sh @@ -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)" ..