Skip to content

Commit

Permalink
Merge pull request #1822 from timblechmann/novacollider/cmake-moderni…
Browse files Browse the repository at this point in the history
…sation

Novacollider/cmake modernisation
  • Loading branch information
crucialfelix committed Mar 17, 2016
2 parents 0bb26b6 + 5194502 commit 6610aa6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ before_script:
- iflin export SCLANG=$TRAVIS_BUILD_DIR/BUILD/Install/bin/sclang

script:
- make install
- sudo make install
- $TRAVIS_BUILD_DIR/testsuite/sclang/launch_test.py $SCLANG

- export COMMIT_NAME=$TRAVIS_COMMIT
Expand Down
25 changes: 13 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,7 @@ if (${CMAKE_COMPILER_IS_GNUCXX})
message(FATAL_ERROR "SuperCollider requires at least gcc-4.8 when compiled with gcc.")
endif()

# disabled for now: -ffast-math breaks avx intrinsics and -fsigned-zeros/-fno-associative-math are not available in some versions
# if (${_gcc_version} VERSION_GREATER 4.0.99)
# add_definitions("-ffast-math -fsigned-zeros -fno-associative-math")
# endif()
add_definitions("-ffast-math -fsigned-zeros -fno-associative-math")

if(APPLE)
exec_program(${CMAKE_CXX_COMPILER} ARGS --version OUTPUT_VARIABLE _gcc_version_info)
Expand All @@ -86,9 +83,7 @@ elseif(${CMAKE_CXX_COMPILER} MATCHES icpc)
add_definitions(-Wno-unknown-pragmas)
add_definitions(-simd)

elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(CMAKE_COMPILER_IS_CLANG 1)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
set(CMAKE_COMPILER_IS_CLANG 1)
endif()

Expand All @@ -110,6 +105,17 @@ endif()

add_definitions(-DBOOST_CHRONO_HEADER_ONLY -DBOOST_NO_AUTO_PTR)


#############################################
# Detect CCache

find_program(CCacheExectuable ccache)
if( CCacheExectuable )
# only used with >=cmake-3.4
set( CMAKE_C_COMPILER_LAUNCHER "${CCacheExectuable}" )
set( CMAKE_CXX_COMPILER_LAUNCHER "${CCacheExectuable}" )
endif()

#############################################
# Options
option(NOVA_SIMD "Build with nova-simd support." ON)
Expand Down Expand Up @@ -190,11 +196,6 @@ if (NOT WIN32)
include_directories(${PTHREADS_INCLUDE_DIR})
endif()

if(MSVC OR MINGW)
set(MATH_LIBRARY "")
else()
find_library(MATH_LIBRARY m)
endif()

if(SYSTEM_BOOST)
set(Boost_USE_MULTITHREADED ON)
Expand Down
11 changes: 6 additions & 5 deletions external_libraries/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ add_library(tlsf STATIC "TLSF-2.4.6/src/tlsf.c")
target_compile_definitions( tlsf PRIVATE TLSF_STATISTIC=1 )
target_include_directories( tlsf INTERFACE TLSF-2.4.6/src )

#oscpack
add_library(oscpack STATIC EXCLUDE_FROM_ALL "oscpack_build.cpp")
target_include_directories(oscpack PRIVATE boost)
target_include_directories(oscpack INTERFACE oscpack_1_1_0 )


if(LTO)
set_property(TARGET oscpack tlsf
APPEND PROPERTY COMPILE_FLAGS "-flto -flto-report")
Expand All @@ -76,11 +82,6 @@ if(LTO)
APPEND PROPERTY LINK_FLAGS "-flto -flto-report")
endif()

#oscpack
add_library(oscpack STATIC EXCLUDE_FROM_ALL "oscpack_build.cpp")
target_include_directories(oscpack PRIVATE boost)
target_include_directories(oscpack INTERFACE oscpack_1_1_0 )

if(NOT YAMLCPP_FOUND)
message(STATUS "using bundled libyaml-cpp")

Expand Down

0 comments on commit 6610aa6

Please sign in to comment.