forked from nasa/nos3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MissionSettings.cmake
43 lines (30 loc) · 1.43 KB
/
MissionSettings.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
message(STATUS "Setting up Mission Settings")
if(NOT CMAKE_BUILD_TYPE)
message(STATUS "No build type set, assuming Debug")
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE)
endif()
set(ARCHITECTURE_STRING "amd64")
set(ITC_C_FLAGS "") #Used for C
set(ITC_CCXX_FLAGS "") #Works for both C/C++
set(CLANG_OVERRIDE "")
set(BOOST_LIBRARYDIR /usr/lib/amd64-linux-gnu)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
message(STATUS "Clang detected. MissionSettings will invoke GCC Compile Flags")
set(CLANG_OVERRIDE True)
endif()
#######GNU Compiler Settings########
if(CMAKE_COMPILER_IS_GNUCXX OR CLANG_OVERRIDE)
include(CheckCCompilerFlag)
#not enabling just yet for gcc
#add_definitions(-Werror) #Turns all warnings into errors
#Options not available on versions of GCC 3.4.6
set(ITC_CCXX_FLAGS "${ITC_CCXX_FLAGS} -fdiagnostics-show-option")
message(STATUS "Setting compiler options...")
#set(ITC_CCXX_FLAGS "${ITC_CCXX_FLAGS} -fPIC")
#set(CMAKE_SHARED_LINKER_FLAGS "-fpic")
#set(CMAKE_EXE_LINKER_FLAGS "-fpic")
CHECK_C_COMPILER_FLAG(-fvisibility=hidden HAVE_VISIBILITY)
endif(CMAKE_COMPILER_IS_GNUCXX OR CLANG_OVERRIDE)
#Removing Visibility check. the core-linux C++ util needs to expose it's symbols in order for cFE to work.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ITC_CCXX_FLAGS} ${ITC_CXX_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ITC_CCXX_FLAGS} ${ITC_C_FLAGS}")