From 99ccb68aaf7f5ef23ce68b6f4b0dd77452810f5f Mon Sep 17 00:00:00 2001 From: RealEther Date: Tue, 9 Jul 2024 22:04:57 +0530 Subject: [PATCH] ubuntu 22 test --- CMakeLists.txt | 33 +++++++++------------------------ 1 file changed, 9 insertions(+), 24 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2227b58d70..13dab20245 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.6) +cmake_minimum_required(VERSION 3.10) set(VERSION "0.1") @@ -13,17 +13,11 @@ configure_file(${CMAKE_SOURCE_DIR}/CTestCustom.cmake ${CMAKE_BINARY_DIR}) project(dogemone) include_directories(include src external "${CMAKE_BINARY_DIR}/version") -if(APPLE) - include_directories(SYSTEM /usr/include/malloc) - enable_language(ASM) -endif() if(MSVC) -include_directories(src/Platform/Windows) -elseif(APPLE) -include_directories(src/Platform/OSX) + include_directories(src/Platform/Windows) else() -include_directories(src/Platform/Linux) + include_directories(src/Platform/Linux) endif() set(STATIC ${MSVC} CACHE BOOL "Link libraries statically") @@ -66,32 +60,25 @@ else() set(C_WARNINGS "-Waggregate-return -Wnested-externs -Wold-style-definition -Wstrict-prototypes") set(CXX_WARNINGS "-Wno-reorder -Wno-missing-field-initializers") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 ${MINGW_FLAG} ${WARNINGS} ${C_WARNINGS} ${ARCH_FLAG} -maes") - if(NOT APPLE) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") - endif() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ${MINGW_FLAG} ${WARNINGS} ${CXX_WARNINGS} ${ARCH_FLAG} -maes") - if(APPLE) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGTEST_HAS_TR1_TUPLE=0") - endif() if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT (CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8)) set(DEBUG_FLAGS "-g3 -Og") else() set(DEBUG_FLAGS "-g3 -O0") endif() set(RELEASE_FLAGS "-Ofast -DNDEBUG -Wno-unused-variable") - if(NOT APPLE) - if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_SYSTEM_NAME STREQUAL "Linux" - AND CMAKE_BUILD_TYPE STREQUAL "Release" AND ((CMAKE_C_COMPILER_VERSION VERSION_GREATER 4.9) OR (CMAKE_C_COMPILER_VERSION VERSION_EQUAL 4.9))) - set(CMAKE_AR gcc-ar) - set(CMAKE_RANLIB gcc-ranlib) - endif() + if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_SYSTEM_NAME STREQUAL "Linux" + AND CMAKE_BUILD_TYPE STREQUAL "Release" AND ((CMAKE_C_COMPILER_VERSION VERSION_GREATER 4.9) OR (CMAKE_C_COMPILER_VERSION VERSION_EQUAL 4.9))) + set(CMAKE_AR gcc-ar) + set(CMAKE_RANLIB gcc-ranlib) set(RELEASE_FLAGS "${RELEASE_FLAGS} -flto") endif() set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${DEBUG_FLAGS}") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${DEBUG_FLAGS}") set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${RELEASE_FLAGS}") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${RELEASE_FLAGS}") - if(STATIC AND NOT APPLE) + if(STATIC) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++") endif() endif() @@ -104,8 +91,6 @@ find_package(Boost 1.55 REQUIRED COMPONENTS system filesystem thread date_time c include_directories(SYSTEM ${Boost_INCLUDE_DIRS}) if(MINGW) set(Boost_LIBRARIES "${Boost_LIBRARIES};ws2_32;mswsock") -elseif(APPLE) - set(Boost_LIBRARIES "${Boost_LIBRARIES}") elseif(NOT MSVC) set(Boost_LIBRARIES "${Boost_LIBRARIES};rt") endif()