Skip to content

Commit

Permalink
Cleanup the CMakeList.txt files
Browse files Browse the repository at this point in the history
  • Loading branch information
benquike committed Feb 28, 2021
1 parent 46ee4c6 commit 3314caf
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
27 changes: 18 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,25 @@ if(NOT COMMAND add_llvm_library)
endif()
if (DEFINED ENV{LLVM_DIR})
# We need to match the build environment for LLVM:
# In particular, we need C++11 and the -fno-rtti flag
# In particular, we need C++14 and the -fno-rtti flag
set(CMAKE_CXX_STANDARD 14)
if(CMAKE_BUILD_TYPE MATCHES "Debug")
set(CMAKE_CXX_FLAGS "-fPIC -std=gnu++14 -g -O0 -fno-rtti -Wno-deprecated -DHAVE_IEEE_754 -DSIZEOF_VOID_P=8 -DSIZEOF_LONG=8")
else()
set(CMAKE_CXX_FLAGS "-fPIC -std=gnu++14 -O3 -fno-rtti -Wno-deprecated -DHAVE_IEEE_754 -DSIZEOF_VOID_P=8 -DSIZEOF_LONG=8")
endif()
set(CMAKE_C_FLAGS "-fPIC")

find_package(LLVM REQUIRED CONFIG)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# add -std=gnu++14
set(CMAKE_CXX_EXTENSIONS ON)

set(COMMON_FLAGS "-fPIC -Werror")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_FLAGS} -fno-rtti")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMMON_FLAGS}")

if(CMAKE_BUILD_TYPE MATCHES "Debug")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3")
endif()

find_package(LLVM REQUIRED CONFIG)

list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")
include(AddLLVM)
Expand Down
6 changes: 5 additions & 1 deletion lib/CUDD/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ set(SOURCES

add_llvm_library(Cudd ${SOURCES} LINK_LIBS m)

set_target_properties(Cudd PROPERTIES COMPILE_FLAGS "-Wno-format -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast -O3 -w -DHAVE_IEEE_754 -DSIZEOF_VOID_P=8 -DSIZEOF_LONG=8")
add_compile_definitions(HAVE_IEEE_754)
add_compile_definitions(SIZEOF_VOID_P=8)
add_compile_definitions(SIZEOF_LONG=8)

set_target_properties(Cudd PROPERTIES COMPILE_FLAGS "-Wno-format -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast")

if(DEFINED IN_SOURCE_BUILD)
add_dependencies(Cudd intrinsics_gen)
Expand Down

0 comments on commit 3314caf

Please sign in to comment.