Commit dd359bca authored by Dominik Bongartz's avatar Dominik Bongartz
Browse files

Update CMakeLists.txt

parent 428c8ac7
cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
MESSAGE("Checking files for FILIB++.")
project(filib C CXX)
project(filib CXX)
set(FILIB_DIR ${PROJECT_SOURCE_DIR}/filib-3.0.2)
add_library(filib
set(FILIB_DIR ${PROJECT_SOURCE_DIR}/filib-3.0.2)
# Note: not allowing filib as shared library since this causes trouble on Windows b/c of static data members...
add_library(filib STATIC
${FILIB_DIR}/fp_traits/fp_traits_base_double_setup.cpp
${FILIB_DIR}/fp_traits/fp_traits_base_float_setup.cpp
${FILIB_DIR}/fp_traits/fp_traits_double_setup.cpp
......@@ -17,21 +18,29 @@ add_library(filib
)
configure_file(${FILIB_DIR}/rounding_control/rounding_control_config.hpp.in rounding_control/rounding_control_config.hpp)
configure_file(${FILIB_DIR}/config.h.in config.h)
target_include_directories(filib
PUBLIC
target_include_directories(filib
PUBLIC
${FILIB_DIR}
${CMAKE_CURRENT_BINARY_DIR}
)
target_compile_options(filib
target_compile_options(filib
PRIVATE
$<$<CXX_COMPILER_ID:MSVC>:-fp:strict>
$<$<CXX_COMPILER_ID:Intel>: $<$<PLATFORM_ID:Windows>:/fp:strict> $<$<NOT:$<PLATFORM_ID:Windows>>:-fp-model:strict>>
)
target_compile_options(filib
PUBLIC
$<$<CXX_COMPILER_ID:MSVC>:-fp:strict;/wd4996>
$<$<CXX_COMPILER_ID:Intel>: $<$<PLATFORM_ID:Windows>:/fp:strict;/Qwd161;/Qwd3346> $<$<NOT:$<PLATFORM_ID:Windows>>:-fp-model:strict -wd161 -wd3346>>
$<$<CXX_COMPILER_ID:MSVC>:/wd4996;/wd4244>
$<$<CXX_COMPILER_ID:Intel>: $<$<PLATFORM_ID:Windows>:/Qwd161;/Qwd3346> $<$<NOT:$<PLATFORM_ID:Windows>>:-wd161 -wd3346>>
$<$<CXX_COMPILER_ID:GNU>:-Wno-deprecated>
$<$<CXX_COMPILER_ID:AppleClang>:-Wno-logical-op-parentheses -Wno-dangling-else -Wno-undefined-var-template>
$<$<CXX_COMPILER_ID:Clang>:-Wno-logical-op-parentheses -Wno-dangling-else -Wno-undefined-var-template -Wno-unknown-pragmas>
)
if(NOT(MSVC))
target_compile_options(filib
set_target_properties(filib PROPERTIES DEBUG_POSTFIX d)
if(MSVC)
target_compile_options(filib PRIVATE /MP;/Qpar)
else()
target_compile_options(filib
PRIVATE
$<$<CXX_COMPILER_ID:Intel>: $<$<NOT:$<CONFIG:DEBUG>>:-O3> $<$<CONFIG:DEBUG>:-O0>>
$<$<CXX_COMPILER_ID:GNU>: $<$<NOT:$<CONFIG:DEBUG>>:-O3> $<$<CONFIG:DEBUG>:-O0>>
......@@ -43,11 +52,6 @@ endif()
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
add_executable(filib-test
${PROJECT_SOURCE_DIR}/test/test.cpp
)
target_compile_options(filib-test
PRIVATE
$<$<CXX_COMPILER_ID:MSVC>:/wd4244>
)
target_link_libraries(filib-test filib)
target_link_libraries(filib-test PRIVATE filib)
endif()
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment