Skip to content

Commit

Permalink
Release version 5.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
montykutyi committed May 4, 2022
1 parent 65c330a commit 3d5fe15
Show file tree
Hide file tree
Showing 414 changed files with 84,771 additions and 8,942 deletions.
15 changes: 13 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,25 @@
url = https://github.com/sed-inf-u-szeged/pmd.git
[submodule "3rdparty/python2"]
path = 3rdparty/python2
url = ../cpython
url = ../cpython.git
ignore = dirty
[submodule "3rdparty/python3"]
path = 3rdparty/python3
url = ../cpython
url = ../cpython.git
ignore = dirty
[submodule "cl/LIM2Patterns/pybind11"]
path = cl/LIM2Patterns/pybind11
url = https://github.com/pybind/pybind11
[submodule "java/lib/openjdk"]
path = java/lib/openjdk
url = ../openjdk
ignore = dirty
[submodule "3rdparty/clang"]
path = 3rdparty/clang
url = ../llvm-project
[submodule "3rdparty/cppheck"]
path = 3rdparty/cppcheck
url = https://github.com/danmar/cppcheck.git
[submodule "3rdparty/miniz"]
path = 3rdparty/miniz
url = https://github.com/richgel999/miniz.git
112 changes: 76 additions & 36 deletions 3rdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
include(ExternalProject)
set(BUILD_SHARED_LIBS OFF)

# All the external static library names should follow this naming convention:
# Linux:
Expand All @@ -11,7 +12,7 @@ file (MAKE_DIRECTORY ${COLUMBUS_3RDPARTY_INSTALL_DIR}/lib)
file (MAKE_DIRECTORY ${COLUMBUS_3RDPARTY_INSTALL_DIR}/include)

# Disable warnings during building 3rdparty code
if (CMAKE_SYSTEM_NAME STREQUAL Linux)
if (CMAKE_CXX_COMPILER_ID MATCHES GNU|Clang)
add_compile_options("-w")
endif()

Expand All @@ -22,7 +23,7 @@ ExternalProject_Add(zlib
PATCH_COMMAND git clean -x -d -f
COMMAND git reset --hard
COMMAND git apply --ignore-whitespace ${CMAKE_CURRENT_SOURCE_DIR}/CMake/zlib.patch
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${COLUMBUS_3RDPARTY_INSTALL_DIR} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${COLUMBUS_3RDPARTY_INSTALL_DIR} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
LOG_CONFIGURE 1
LOG_BUILD 1
LOG_INSTALL 1
Expand All @@ -39,26 +40,26 @@ endif()


########################### boost ########################
if (CMAKE_SYSTEM_NAME STREQUAL Windows)
if (COLUMBUS_64BIT)
set (BOOST_ADDRESS_MODEL address-model=64)
endif ()
set (BOOST_MSVC_TOOLSET toolset=msvc-14.1)
endif ()


if (CMAKE_SYSTEM_NAME STREQUAL Linux)
if (CMAKE_CXX_COMPILER_ID STREQUAL MSVC)
set (BOOST_TOOLSET toolset=msvc-14.1)
elseif (CMAKE_CXX_COMPILER_ID MATCHES GNU|Clang)
set (BOOST_EXTRA_CXX_COMPILER_FLAGS cxxflags=-fPIC)
set (BOOST_EXTRA_C_COMPILER_FLAGS cflags=-fPIC)
endif ()
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set (BOOST_TOOLSET toolset=gcc-${CMAKE_CXX_COMPILER_VERSION})
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set (BOOST_TOOLSET toolset=clang-${CMAKE_CXX_COMPILER_VERSION})
endif()
endif ()

ExternalProject_Add(boost
DEPENDS zlib
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/boost
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND ${COMMAND_PREFIX}bootstrap${SCRIPT_EXT}
BUILD_COMMAND ${COMMAND_PREFIX}b2 ${BOOST_EXTRA_CXX_COMPILER_FLAGS} ${BOOST_EXTRA_C_COMPILER_FLAGS} ${BOOST_MSVC_TOOLSET} --reconfigure --build-dir=${CMAKE_CURRENT_BINARY_DIR}/boost-prefix --prefix=${COLUMBUS_3RDPARTY_INSTALL_DIR} -j8 --with-filesystem --with-system --with-date_time --with-iostreams --with-graph --with-regex --with-thread --with-math --layout=system variant=$<$<CONFIG:Debug>:debug>$<$<CONFIG:Release>:release> runtime-link=static architecture=x86 threading=multi ${BOOST_ADDRESS_MODEL} link=static -sZLIB_INCLUDE=${COLUMBUS_3RDPARTY_INSTALL_DIR}/include -sZLIB_LIBPATH=${COLUMBUS_3RDPARTY_INSTALL_DIR}/lib -sZLIB_BINARY=z -sNO_ZLIB=0 -sNO_BZIP2=1 headers
COMMAND ${COMMAND_PREFIX}b2 ${BOOST_EXTRA_CXX_COMPILER_FLAGS} ${BOOST_EXTRA_C_COMPILER_FLAGS} ${BOOST_MSVC_TOOLSET} --reconfigure --build-dir=${CMAKE_CURRENT_BINARY_DIR}/boost-prefix --prefix=${COLUMBUS_3RDPARTY_INSTALL_DIR} -j8 --with-filesystem --with-system --with-date_time --with-iostreams --with-graph --with-regex --with-thread --with-math --layout=system variant=$<$<CONFIG:Debug>:debug>$<$<CONFIG:Release>:release> runtime-link=static architecture=x86 threading=multi ${BOOST_ADDRESS_MODEL} link=static -sZLIB_INCLUDE=${COLUMBUS_3RDPARTY_INSTALL_DIR}/include -sZLIB_LIBPATH=${COLUMBUS_3RDPARTY_INSTALL_DIR}/lib -sZLIB_BINARY=z -sNO_ZLIB=0 -sNO_BZIP2=1 install
BUILD_COMMAND ${COMMAND_PREFIX}b2 ${BOOST_EXTRA_CXX_COMPILER_FLAGS} ${BOOST_EXTRA_C_COMPILER_FLAGS} ${BOOST_TOOLSET} --reconfigure --build-dir=${CMAKE_CURRENT_BINARY_DIR}/boost-prefix --prefix=${COLUMBUS_3RDPARTY_INSTALL_DIR} -j8 --with-filesystem --with-system --with-date_time --with-iostreams --with-graph --with-regex --with-thread --with-math --layout=system variant=$<$<CONFIG:Debug>:debug>$<$<CONFIG:Release>:release> runtime-link=static architecture=x86 threading=multi address-model=64 link=static -sZLIB_INCLUDE=${COLUMBUS_3RDPARTY_INSTALL_DIR}/include -sZLIB_LIBPATH=${COLUMBUS_3RDPARTY_INSTALL_DIR}/lib -sZLIB_BINARY=z -sNO_ZLIB=0 -sNO_BZIP2=1 headers
COMMAND ${COMMAND_PREFIX}b2 ${BOOST_EXTRA_CXX_COMPILER_FLAGS} ${BOOST_EXTRA_C_COMPILER_FLAGS} ${BOOST_TOOLSET} --reconfigure --build-dir=${CMAKE_CURRENT_BINARY_DIR}/boost-prefix --prefix=${COLUMBUS_3RDPARTY_INSTALL_DIR} -j8 --with-filesystem --with-system --with-date_time --with-iostreams --with-graph --with-regex --with-thread --with-math --layout=system variant=$<$<CONFIG:Debug>:debug>$<$<CONFIG:Release>:release> runtime-link=static architecture=x86 threading=multi address-model=64 link=static -sZLIB_INCLUDE=${COLUMBUS_3RDPARTY_INSTALL_DIR}/include -sZLIB_LIBPATH=${COLUMBUS_3RDPARTY_INSTALL_DIR}/lib -sZLIB_BINARY=z -sNO_ZLIB=0 -sNO_BZIP2=1 install
INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "No sepearate installation step is needed."
LOG_CONFIGURE 1
LOG_BUILD 1
Expand Down Expand Up @@ -116,12 +117,6 @@ if (CMAKE_SYSTEM_NAME STREQUAL Linux)

elseif (CMAKE_SYSTEM_NAME STREQUAL Windows)

if (COLUMBUS_64BIT)
set (XERCESC_BUILD_OUTPUT_DIR Win64)
else()
set (XERCESC_BUILD_OUTPUT_DIR Win32)
endif ()

ExternalProject_Add( xerces-c
URL https://archive.apache.org/dist/xerces/c/3/sources/xerces-c-3.1.4.zip
URL_HASH MD5=6fcd8ec268f6bfe11d8ce2cd7d25a185
Expand All @@ -130,7 +125,7 @@ elseif (CMAKE_SYSTEM_NAME STREQUAL Windows)
BUILD_COMMAND msbuild projects/Win32/VC14/xerces-all/xerces-all.sln /m /t:XercesLib "/p:Configuration=Static $<CONFIG>" /p:Platform=${VS_PLATFORM} /p:PlatformToolset=${CMAKE_VS_PLATFORM_TOOLSET}
INSTALL_COMMAND ${CMAKE_COMMAND} "-DCOPY_SOURCE=${CMAKE_CURRENT_BINARY_DIR}/xerces-c-prefix/src/xerces-c/src/xercesc/" "-DCOPY_TARGET=${COLUMBUS_3RDPARTY_INSTALL_DIR}/include/xercesc" -DCOPY_PATTERN=*.hpp -P ${CMAKE_CURRENT_SOURCE_DIR}/CMake/SearchAndCopyFiles.cmake
COMMAND ${CMAKE_COMMAND} "-DCOPY_SOURCE=${CMAKE_CURRENT_BINARY_DIR}/xerces-c-prefix/src/xerces-c/src/xercesc/" "-DCOPY_TARGET=${COLUMBUS_3RDPARTY_INSTALL_DIR}/include/xercesc" -DCOPY_PATTERN=*.c -P ${CMAKE_CURRENT_SOURCE_DIR}/CMake/SearchAndCopyFiles.cmake
COMMAND ${CMAKE_COMMAND} -E copy "Build/${XERCESC_BUILD_OUTPUT_DIR}/VC14/Static $<CONFIG>/xerces-c_static_3$<$<CONFIG:Debug>:d>.lib" ${COLUMBUS_3RDPARTY_INSTALL_DIR}/lib/xerces-c.lib
COMMAND ${CMAKE_COMMAND} -E copy "Build/Win64/VC14/Static $<CONFIG>/xerces-c_static_3$<$<CONFIG:Debug>:d>.lib" ${COLUMBUS_3RDPARTY_INSTALL_DIR}/lib/xerces-c.lib
LOG_DOWNLOAD 1
LOG_CONFIGURE 1
LOG_BUILD 1
Expand All @@ -143,22 +138,20 @@ endif ()
set (PMD_PACKAGE_VERSION pmd-bin-6.32.0)
set (PMD_DIST_PACKAGE ${CMAKE_CURRENT_SOURCE_DIR}/PMD/pmd-dist/target/${PMD_PACKAGE_VERSION}.zip)
set (PMD_PACKAGE ${COLUMBUS_3RDPARTY_INSTALL_DIR}/PMD.zip)
if (CMAKE_SYSTEM_NAME STREQUAL Windows AND NOT COLUMBUS_64BIT)
set (PMD_MAVEN_OPTS ${CMAKE_COMMAND} -E env MAVEN_OPTS=-Xss16m)
endif ()
if (CMAKE_SYSTEM_NAME STREQUAL Windows)
set (MVNW_POSTFIX .cmd)
endif ()

add_custom_command (
OUTPUT ${PMD_PACKAGE}
COMMAND ${PMD_MAVEN_OPTS} ${COMMAND_PREFIX}mvnw${MVNW_POSTFIX} package -DskipTests -Dmaven.test.skip=true -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -pl pmd-dist,pmd-core,pmd-java > ${CMAKE_CURRENT_BINARY_DIR}/PMD-build.log 2>&1
COMMAND ${COMMAND_PREFIX}mvnw${MVNW_POSTFIX} package -DskipTests -Dmaven.test.skip=true -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -pl pmd-dist,pmd-core,pmd-java > ${CMAKE_CURRENT_BINARY_DIR}/PMD-build.log 2>&1
COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_CURRENT_SOURCE_DIR}/PMD/pmd-dist/target/ ${CMAKE_COMMAND} -E remove_directory PMD
COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_CURRENT_SOURCE_DIR}/PMD/pmd-dist/target/ ${CMAKE_COMMAND} -E tar xf ${PMD_DIST_PACKAGE}
COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_CURRENT_SOURCE_DIR}/PMD/pmd-dist/target/ ${CMAKE_COMMAND} -E rename ${PMD_PACKAGE_VERSION} PMD
COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_CURRENT_SOURCE_DIR}/PMD/pmd-dist/target/ ${CMAKE_COMMAND} -E tar cf ${PMD_DIST_PACKAGE} --format=zip PMD
COMMAND ${CMAKE_COMMAND} -E copy ${PMD_DIST_PACKAGE} ${PMD_PACKAGE}
COMMENT "Building PMD"
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/PMD
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/PMD
)

Expand All @@ -175,7 +168,7 @@ set_target_properties (PMD PROPERTIES FOLDER "ExternalProjectTargets/pmd")
ExternalProject_Add( spotbugs
URL https://repo.maven.apache.org/maven2/com/github/spotbugs/spotbugs/4.2.2/spotbugs-4.2.2.tgz
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
BUILD_COMMAND ${CMAKE_COMMAND} -P ${CMAKE_MODULE_PATH}/AddExecutablePermission.cmake ${CMAKE_CURRENT_BINARY_DIR}/spotbugs-prefix/src/spotbugs/bin/spotbugs
INSTALL_COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_CURRENT_BINARY_DIR}/spotbugs-prefix/src ${CMAKE_COMMAND} -E tar cf ${COLUMBUS_3RDPARTY_INSTALL_DIR}/spotbugs.zip --format=zip spotbugs
LOG_DOWNLOAD 1
LOG_INSTALL 1
Expand All @@ -196,9 +189,6 @@ if (CMAKE_SYSTEM_NAME STREQUAL Linux)
LOG_INSTALL 1
)
elseif (CMAKE_SYSTEM_NAME STREQUAL Windows)
if (COLUMBUS_64BIT)
set (PYTHON_BUILD_OUTPUT_DIR amd64)
endif ()

ExternalProject_Add( python2.7
DEPENDS zlib
Expand All @@ -208,7 +198,7 @@ elseif (CMAKE_SYSTEM_NAME STREQUAL Windows)
BUILD_COMMAND msbuild PCbuild/pythoncore.vcxproj /m /t:Build /p:Configuration=$<CONFIG> /p:Platform=${VS_PLATFORM} /p:PlatformToolset=${CMAKE_VS_PLATFORM_TOOLSET}
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory Include ${COLUMBUS_3RDPARTY_INSTALL_DIR}/include/python2.7
COMMAND ${CMAKE_COMMAND} -E copy "PC/pyconfig.h" ${COLUMBUS_3RDPARTY_INSTALL_DIR}/include/python2.7/pyconfig.h
COMMAND ${CMAKE_COMMAND} -E copy "PCbuild/${PYTHON_BUILD_OUTPUT_DIR}/python27$<$<CONFIG:Debug>:_d>.lib" ${COLUMBUS_3RDPARTY_INSTALL_DIR}/lib/python2.7.lib
COMMAND ${CMAKE_COMMAND} -E copy "PCbuild/amd64/python27$<$<CONFIG:Debug>:_d>.lib" ${COLUMBUS_3RDPARTY_INSTALL_DIR}/lib/python2.7.lib
LOG_CONFIGURE 1
LOG_BUILD 1
LOG_INSTALL 1
Expand Down Expand Up @@ -246,18 +236,35 @@ elseif (CMAKE_SYSTEM_NAME STREQUAL Windows)
)
endif ()

###################### cppcheck ############################

if (CMAKE_SYSTEM_NAME STREQUAL Linux OR CMAKE_SYSTEM_NAME STREQUAL Darwin)
ExternalProject_Add( cppcheck
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/cppcheck
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${COLUMBUS_3RDPARTY_INSTALL_DIR} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
LOG_CONFIGURE 1
LOG_BUILD 1
LOG_INSTALL 1
)

elseif (CMAKE_SYSTEM_NAME STREQUAL Windows)

ExternalProject_Add( cppcheck
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/cppcheck
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${COLUMBUS_3RDPARTY_INSTALL_DIR} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
LOG_CONFIGURE 1
LOG_BUILD 1
LOG_INSTALL 1
)

endif()

###################### openssl ############################

if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
if (CMAKE_CL_64)
set (OPENSSL_PLATFORM VC-WIN64A)
else ()
set (OPENSSL_PLATFORM VC-WIN32)
endif ()

ExternalProject_Add( openssl
URL https://www.openssl.org/source/openssl-1.1.0h.tar.gz
CONFIGURE_COMMAND perl ../openssl/Configure --prefix=${COLUMBUS_3RDPARTY_INSTALL_DIR} --openssldir=ssl ${OPENSSL_PLATFORM} ${DEBUG_BUILD} -no-shared
CONFIGURE_COMMAND perl ../openssl/Configure --prefix=${COLUMBUS_3RDPARTY_INSTALL_DIR} --openssldir=ssl VC-WIN64A ${DEBUG_BUILD} -no-shared
BUILD_COMMAND nmake
INSTALL_COMMAND nmake install
LOG_CONFIGURE 1
Expand All @@ -279,3 +286,36 @@ if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
)

endif ()

###################### llvm/clang ############################

if (CMAKE_SYSTEM_NAME STREQUAL Linux)

ExternalProject_Add( clang
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/clang/llvm
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${COLUMBUS_3RDPARTY_INSTALL_DIR} -DCMAKE_EXE_LINKER_FLAGS=${CMAKE_EXE_LINKER_FLAGS} -DLLVM_ENABLE_RTTI=ON -DLLVM_OPTIMIZED_TABLEGEN=ON -DLLVM_ENABLE_SPHINX=ON "-DLLVM_ENABLE_PROJECTS=clang\\$<SEMICOLON>clang-tools-extra" -DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --config $<CONFIG> --parallel ${PHYSICAL_CORES} -t install-llvm-libraries-stripped -t install-clang-libraries-stripped -t install-clang-headers -t install-llvm-headers -t install-clang-tidy-stripped -t install-clang-resource-headers
INSTALL_COMMAND ""
LOG_CONFIGURE 1
LOG_BUILD 1
LOG_INSTALL 1
)

elseif (CMAKE_SYSTEM_NAME STREQUAL Windows)

ExternalProject_Add( clang
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/clang/llvm
CMAKE_GENERATOR Ninja
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${COLUMBUS_3RDPARTY_INSTALL_DIR} -DLLVM_USE_CRT_DEBUG=MTd -DLLVM_USE_CRT_RELEASE=MT -DLLVM_ENABLE_RTTI=ON "-DLLVM_ENABLE_PROJECTS=clang\\$<SEMICOLON>clang-tools-extra" -DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_GENERATOR_TOOLSET=
BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --config $<CONFIG> --parallel ${PHYSICAL_CORES} -t install-llvm-libraries-stripped -t install-clang-libraries-stripped -t install-clang-headers -t install-llvm-headers -t install-clang-tidy-stripped -t install-clang-resource-headers
INSTALL_COMMAND ""
LOG_CONFIGURE 1
LOG_BUILD 1
LOG_INSTALL 1
)

endif()


######################## miniz #################################
add_subdirectory(miniz)
1 change: 1 addition & 0 deletions 3rdparty/clang
Submodule clang added at 3ce9f5
1 change: 1 addition & 0 deletions 3rdparty/cppcheck
Submodule cppcheck added at f5b44b
1 change: 1 addition & 0 deletions 3rdparty/miniz
Submodule miniz added at 8a7cf6
10 changes: 10 additions & 0 deletions CMake/AddExecutablePermission.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
math(EXPR length "${CMAKE_ARGC} - 1") # ${CMAKE_ARGC} - 1 is the exact number of arguments

foreach (item RANGE 3 ${length})
File (CHMOD_RECURSE
${CMAKE_ARGV${item}}
FILE_PERMISSIONS OWNER_EXECUTE OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
)
endforeach()
endif()
5 changes: 5 additions & 0 deletions CMake/BuildInfo.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,9 @@ add_custom_target (
set_target_properties (generate_build_info PROPERTIES FOLDER ${CMAKE_SUPPORT_FOLDER_NAME})


cmake_host_system_information(RESULT HOST_INFO
QUERY TOTAL_PHYSICAL_MEMORY NUMBER_OF_LOGICAL_CORES NUMBER_OF_PHYSICAL_CORES)

list (GET HOST_INFO 0 PHYSYCAL_MEMORY)
list (GET HOST_INFO 1 LOGICAL_CORES)
list (GET HOST_INFO 2 PHYSICAL_CORES)
39 changes: 39 additions & 0 deletions CMake/Clang.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

set (CLANG_COMMON_LIBRARIES
clangMetrics
clangTooling
clangFrontend
clangRewriteFrontend
clangSerialization
clangParse
clangSema
clangEdit
clangLex
clangAnalysis
clangRewrite
clangASTMatchers
clangAST
clangDriver
clangBasic

LLVMMCParser
LLVMMC
LLVMProfileData
LLVMBitReader
LLVMBitstreamReader
LLVMCore
LLVMSupport
LLVMOption
LLVMDemangle
LLVMBinaryFormat
LLVMRemarks
LLVMFrontendOpenMP
)

if (CMAKE_SYSTEM_NAME STREQUAL Windows)
list (APPEND CLANG_COMMON_LIBRARIES version)
elseif (CMAKE_SYSTEM_NAME STREQUAL Linux)
list (APPEND CLANG_COMMON_LIBRARIES pthread z tinfo dl)
elseif (CMAKE_SYSTEM_NAME STREQUAL Darwin)
list (APPEND CLANG_COMMON_LIBRARIES pthread z dl curses)
endif ()
8 changes: 2 additions & 6 deletions CMake/CodebaseOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ set (COLUMBUS_3RDPARTY_SOURCE_DIR ${CMAKE_SOURCE_DIR}/3rdparty)

# Compiler warning settings
if (MSVC)
# For ninja builds on windows we set the CMAKE_VS_PLATFORM_TOOLSET to V140 (VS2015)
if (NOT CMAKE_VS_PLATFORM_TOOLSET)
set (CMAKE_VS_PLATFORM_TOOLSET V140 CACHE STRING "" FORCE)
endif ()

# Disable some common compiler warnings end enable parallel build
set (EXTRA_COMPILER_OPTIONS "/WX /wd4996 /wd4267 /wd4786 /wd4244 /wd4068 /MP /EHsc /experimental:external /external:W0 /external:I ${COLUMBUS_3RDPARTY_INSTALL_DIR}/include")

Expand All @@ -51,6 +46,7 @@ elseif (CMAKE_SYSTEM_NAME STREQUAL Linux)

# Enable compiler warnings and use fPIC option
set (EXTRA_COMPILER_OPTIONS "-Wall -Werror -Wno-unused-local-typedefs -Wno-unknown-pragmas -fPIC")
set (EXTRA_CXX_FLAGS "-Wno-overloaded-virtual")

if (STRIP)
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s")
Expand All @@ -60,7 +56,7 @@ elseif (CMAKE_SYSTEM_NAME STREQUAL Linux)

endif ()

set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_COMPILER_OPTIONS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_COMPILER_OPTIONS} ${EXTRA_CXX_FLAGS}")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_COMPILER_OPTIONS}")

# Common global dependencies
Expand Down
29 changes: 11 additions & 18 deletions CMake/PlatformOptions.cmake
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@


set (COLUMBUS_64BIT FALSE)

if (((CMAKE_SYSTEM_NAME STREQUAL Windows) AND CMAKE_CL_64) OR (CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64))
set (COLUMBUS_64BIT TRUE)
endif ()

if (COLUMBUS_64BIT)
set (COLUMBUS_PLATFORM_NAME x64)
set (VS_PLATFORM x64)
set (VS_PLATFORM_DIR x64/)
set (PYTHON_PLATFORM_NAME amd64)
else ()
set (COLUMBUS_PLATFORM_NAME x86)
set (VS_PLATFORM WIN32)
set (VS_PLATFORM_DIR )
set (PYTHON_PLATFORM_NAME win32)
endif ()
message ("C++ Compiler:" ${CMAKE_CXX_COMPILER_ID} "-" ${CMAKE_CXX_COMPILER_VERSION} " " (${CMAKE_CXX_COMPILER}))
message ("C Compiler:" ${CMAKE_C_COMPILER_ID} "-" ${CMAKE_C_COMPILER_VERSION} " " (${CMAKE_C_COMPILER}))
if (NOT CMAKE_CXX_COMPILER_ID MATCHES GNU|Clang|MSVC)
message("ERROR: Not supported compiler!")
endif()


set (COLUMBUS_PLATFORM_NAME x64)
set (VS_PLATFORM x64)
set (VS_PLATFORM_DIR x64/)
set (PYTHON_PLATFORM_NAME amd64)

if (CMAKE_SYSTEM_NAME STREQUAL Windows)
set (SCRIPT_EXT .bat)
Expand All @@ -33,7 +25,8 @@ set (COLUMBUS_PLATFORM_DEPENDENT_DIR ${COLUMBUS_PLATFORM_NAME})
set (EXE ${CMAKE_EXECUTABLE_SUFFIX})


if(${WIN32})
# Sets the msvs for the node-gyp required for the javascript
if(MSVC)
if(${CMAKE_VS_PLATFORM_TOOLSET} STREQUAL "v90")
set (MSVS_VERSION "--msvs_version=2008")
elseif(${CMAKE_VS_PLATFORM_TOOLSET} STREQUAL "v100")
Expand Down
Loading

0 comments on commit 3d5fe15

Please sign in to comment.