Skip to content
Snippets Groups Projects
Commit 0a19c8df authored by Karsten Suehring's avatar Karsten Suehring
Browse files

remove OS "Darwin" check from CMake definitions

parent 6ed46b25
No related branches found
No related tags found
No related merge requests found
......@@ -27,14 +27,6 @@ set( SKIP_SVN_REVISION OFF CACHE BOOL "Don't add SVN path and revision info to t
set( SET_ENABLE_TRACING OFF CACHE BOOL "Set ENABLE_TRACING as a compiler flag" )
set( ENABLE_TRACING OFF CACHE BOOL "If SET_ENABLE_TRACING is on, it will be set to this value" )
if( ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
else()
set( SET_ENABLE_SPLIT_PARALLELISM OFF CACHE BOOL "Set ENABLE_SPLIT_PARALLELISM as a compiler flag" )
set( ENABLE_SPLIT_PARALLELISM OFF CACHE BOOL "If SET_ENABLE_SPLIT_PARALLELISM is on, it will be set to this value" )
set( SET_ENABLE_WPP_PARALLELISM OFF CACHE BOOL "Set ENABLE_WPP_PARALLELISM as a compiler flag" )
set( ENABLE_WPP_PARALLELISM OFF CACHE BOOL "If SET_ENABLE_WPP_PARALLELISM is on, it will be set to this value" )
endif()
if( CMAKE_COMPILER_IS_GNUCC )
set( BUILD_STATIC OFF CACHE BOOL "Build static executables" )
endif()
......@@ -58,6 +50,19 @@ include( ${CMAKE_SOURCE_DIR}/cmake/CMakeBuild/cmake/modules/BBuildEnv.cmake )
# Enable multithreading
bb_multithreading()
find_package(OpenMP)
if( OpenMP_FOUND )
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}" )
set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}" )
set( SET_ENABLE_SPLIT_PARALLELISM OFF CACHE BOOL "Set ENABLE_SPLIT_PARALLELISM as a compiler flag" )
set( ENABLE_SPLIT_PARALLELISM OFF CACHE BOOL "If SET_ENABLE_SPLIT_PARALLELISM is on, it will be set to this value" )
set( SET_ENABLE_WPP_PARALLELISM OFF CACHE BOOL "Set ENABLE_WPP_PARALLELISM as a compiler flag" )
set( ENABLE_WPP_PARALLELISM OFF CACHE BOOL "If SET_ENABLE_WPP_PARALLELISM is on, it will be set to this value" )
endif()
# Enable warnings for some generators and toolsets.
bb_enable_warnings( gcc warnings-as-errors -Wno-sign-compare )
# bb_enable_warnings( gcc -Wno-unused-variable )
......@@ -109,17 +114,6 @@ if( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
endif()
endif()
if( ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
add_definitions( -DENABLE_SPLIT_PARALLELISM=0 )
else()
find_package( OpenMP )
if( OPENMP_FOUND )
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}" )
set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}" )
endif()
endif()
# modify .lldbinit for lldb custom data formatters
if( XCODE )
set( LLDB_INSTALL_ROOT "$ENV{HOME}/.lldb.d" )
......
......@@ -35,10 +35,7 @@ if( SET_ENABLE_TRACING )
endif()
endif()
if( ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
target_compile_definitions( ${EXE_NAME} PUBLIC ENABLE_SPLIT_PARALLELISM=0 )
target_compile_definitions( ${EXE_NAME} PUBLIC ENABLE_WPP_PARALLELISM=0 )
else()
if( OpenMP_FOUND )
if( SET_ENABLE_SPLIT_PARALLELISM )
if( ENABLE_SPLIT_PARALLELISM )
target_compile_definitions( ${EXE_NAME} PUBLIC ENABLE_SPLIT_PARALLELISM=1 )
......@@ -53,6 +50,9 @@ else()
target_compile_definitions( ${EXE_NAME} PUBLIC ENABLE_WPP_PARALLELISM=0 )
endif()
endif()
else()
target_compile_definitions( ${EXE_NAME} PUBLIC ENABLE_SPLIT_PARALLELISM=0 )
target_compile_definitions( ${EXE_NAME} PUBLIC ENABLE_WPP_PARALLELISM=0 )
endif()
if( CMAKE_COMPILER_IS_GNUCC AND BUILD_STATIC )
......
......@@ -35,10 +35,7 @@ if( SET_ENABLE_TRACING )
endif()
endif()
if( ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
target_compile_definitions( ${EXE_NAME} PUBLIC ENABLE_SPLIT_PARALLELISM=0 )
target_compile_definitions( ${EXE_NAME} PUBLIC ENABLE_WPP_PARALLELISM=0 )
else()
if( OpenMP_FOUND )
if( SET_ENABLE_SPLIT_PARALLELISM )
if( ENABLE_SPLIT_PARALLELISM )
target_compile_definitions( ${EXE_NAME} PUBLIC ENABLE_SPLIT_PARALLELISM=1 )
......@@ -53,6 +50,9 @@ else()
target_compile_definitions( ${EXE_NAME} PUBLIC ENABLE_WPP_PARALLELISM=0 )
endif()
endif()
else()
target_compile_definitions( ${EXE_NAME} PUBLIC ENABLE_SPLIT_PARALLELISM=0 )
target_compile_definitions( ${EXE_NAME} PUBLIC ENABLE_WPP_PARALLELISM=0 )
endif()
if( CMAKE_COMPILER_IS_GNUCC AND BUILD_STATIC )
......
......@@ -36,10 +36,7 @@ if( SET_ENABLE_TRACING )
endif()
endif()
if( ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
target_compile_definitions( ${EXE_NAME} PUBLIC ENABLE_SPLIT_PARALLELISM=0 )
target_compile_definitions( ${EXE_NAME} PUBLIC ENABLE_WPP_PARALLELISM=0 )
else()
if( OpenMP_FOUND )
if( SET_ENABLE_SPLIT_PARALLELISM )
if( ENABLE_SPLIT_PARALLELISM )
target_compile_definitions( ${EXE_NAME} PUBLIC ENABLE_SPLIT_PARALLELISM=1 )
......@@ -54,6 +51,9 @@ else()
target_compile_definitions( ${EXE_NAME} PUBLIC ENABLE_WPP_PARALLELISM=0 )
endif()
endif()
else()
target_compile_definitions( ${EXE_NAME} PUBLIC ENABLE_SPLIT_PARALLELISM=0 )
target_compile_definitions( ${EXE_NAME} PUBLIC ENABLE_WPP_PARALLELISM=0 )
endif()
if( CMAKE_COMPILER_IS_GNUCC AND BUILD_STATIC )
......
......@@ -34,10 +34,7 @@ if( SET_ENABLE_TRACING )
endif()
endif()
if( ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
target_compile_definitions( ${EXE_NAME} PUBLIC ENABLE_SPLIT_PARALLELISM=0 )
target_compile_definitions( ${EXE_NAME} PUBLIC ENABLE_WPP_PARALLELISM=0 )
else()
if( OpenMP_FOUND )
if( SET_ENABLE_SPLIT_PARALLELISM )
if( ENABLE_SPLIT_PARALLELISM )
target_compile_definitions( ${EXE_NAME} PUBLIC ENABLE_SPLIT_PARALLELISM=1 )
......@@ -52,6 +49,9 @@ else()
target_compile_definitions( ${EXE_NAME} PUBLIC ENABLE_WPP_PARALLELISM=0 )
endif()
endif()
else()
target_compile_definitions( ${EXE_NAME} PUBLIC ENABLE_SPLIT_PARALLELISM=0 )
target_compile_definitions( ${EXE_NAME} PUBLIC ENABLE_WPP_PARALLELISM=0 )
endif()
if( CMAKE_COMPILER_IS_GNUCC AND BUILD_STATIC )
......
......@@ -52,10 +52,7 @@ if( SET_ENABLE_TRACING )
endif()
endif()
if( ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
target_compile_definitions( ${LIB_NAME} PUBLIC ENABLE_SPLIT_PARALLELISM=0 )
target_compile_definitions( ${LIB_NAME} PUBLIC ENABLE_WPP_PARALLELISM=0 )
else()
if( OpenMP_FOUND )
if( SET_ENABLE_SPLIT_PARALLELISM )
if( ENABLE_SPLIT_PARALLELISM )
target_compile_definitions( ${LIB_NAME} PUBLIC ENABLE_SPLIT_PARALLELISM=1 )
......@@ -70,6 +67,9 @@ else()
target_compile_definitions( ${LIB_NAME} PUBLIC ENABLE_WPP_PARALLELISM=0 )
endif()
endif()
else()
target_compile_definitions( ${LIB_NAME} PUBLIC ENABLE_SPLIT_PARALLELISM=0 )
target_compile_definitions( ${LIB_NAME} PUBLIC ENABLE_WPP_PARALLELISM=0 )
endif()
target_include_directories( ${LIB_NAME} PUBLIC . .. ./x86 ../libmd5 )
......
......@@ -24,10 +24,7 @@ if( SET_ENABLE_TRACING )
endif()
endif()
if( ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
target_compile_definitions( ${LIB_NAME} PUBLIC ENABLE_SPLIT_PARALLELISM=0 )
target_compile_definitions( ${LIB_NAME} PUBLIC ENABLE_WPP_PARALLELISM=0 )
else()
if( OpenMP_FOUND )
if( SET_ENABLE_SPLIT_PARALLELISM )
if( ENABLE_SPLIT_PARALLELISM )
target_compile_definitions( ${LIB_NAME} PUBLIC ENABLE_SPLIT_PARALLELISM=1 )
......@@ -42,6 +39,9 @@ else()
target_compile_definitions( ${LIB_NAME} PUBLIC ENABLE_WPP_PARALLELISM=0 )
endif()
endif()
else()
target_compile_definitions( ${LIB_NAME} PUBLIC ENABLE_SPLIT_PARALLELISM=0 )
target_compile_definitions( ${LIB_NAME} PUBLIC ENABLE_WPP_PARALLELISM=0 )
endif()
target_include_directories( ${LIB_NAME} PUBLIC ../DecoderLib )
......
......@@ -24,10 +24,7 @@ if( SET_ENABLE_TRACING )
endif()
endif()
if( ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
target_compile_definitions( ${LIB_NAME} PUBLIC ENABLE_SPLIT_PARALLELISM=0 )
target_compile_definitions( ${LIB_NAME} PUBLIC ENABLE_WPP_PARALLELISM=0 )
else()
if( OpenMP_FOUND )
if( SET_ENABLE_SPLIT_PARALLELISM )
if( ENABLE_SPLIT_PARALLELISM )
target_compile_definitions( ${LIB_NAME} PUBLIC ENABLE_SPLIT_PARALLELISM=1 )
......@@ -42,6 +39,9 @@ else()
target_compile_definitions( ${LIB_NAME} PUBLIC ENABLE_WPP_PARALLELISM=0 )
endif()
endif()
else()
target_compile_definitions( ${LIB_NAME} PUBLIC ENABLE_SPLIT_PARALLELISM=0 )
target_compile_definitions( ${LIB_NAME} PUBLIC ENABLE_WPP_PARALLELISM=0 )
endif()
target_include_directories( ${LIB_NAME} PUBLIC . )
......
......@@ -24,10 +24,7 @@ if( SET_ENABLE_TRACING )
endif()
endif()
if( ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
target_compile_definitions( ${LIB_NAME} PUBLIC ENABLE_SPLIT_PARALLELISM=0 )
target_compile_definitions( ${LIB_NAME} PUBLIC ENABLE_WPP_PARALLELISM=0 )
else()
if( OpenMP_FOUND )
if( SET_ENABLE_SPLIT_PARALLELISM )
if( ENABLE_SPLIT_PARALLELISM )
target_compile_definitions( ${LIB_NAME} PUBLIC ENABLE_SPLIT_PARALLELISM=1 )
......@@ -42,6 +39,9 @@ else()
target_compile_definitions( ${LIB_NAME} PUBLIC ENABLE_WPP_PARALLELISM=0 )
endif()
endif()
else()
target_compile_definitions( ${LIB_NAME} PUBLIC ENABLE_SPLIT_PARALLELISM=0 )
target_compile_definitions( ${LIB_NAME} PUBLIC ENABLE_WPP_PARALLELISM=0 )
endif()
target_include_directories( ${LIB_NAME} PUBLIC . )
......
......@@ -24,10 +24,7 @@ if( SET_ENABLE_TRACING )
endif()
endif()
if( ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
target_compile_definitions( ${LIB_NAME} PUBLIC ENABLE_SPLIT_PARALLELISM=0 )
target_compile_definitions( ${LIB_NAME} PUBLIC ENABLE_WPP_PARALLELISM=0 )
else()
if( OpenMP_FOUND )
if( SET_ENABLE_SPLIT_PARALLELISM )
if( ENABLE_SPLIT_PARALLELISM )
target_compile_definitions( ${LIB_NAME} PUBLIC ENABLE_SPLIT_PARALLELISM=1 )
......@@ -42,6 +39,9 @@ else()
target_compile_definitions( ${LIB_NAME} PUBLIC ENABLE_WPP_PARALLELISM=0 )
endif()
endif()
else()
target_compile_definitions( ${LIB_NAME} PUBLIC ENABLE_SPLIT_PARALLELISM=0 )
target_compile_definitions( ${LIB_NAME} PUBLIC ENABLE_WPP_PARALLELISM=0 )
endif()
target_include_directories( ${LIB_NAME} PUBLIC . .. )
......
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