diff options
Diffstat (limited to 'cmake/opentrack-platform.cmake')
-rw-r--r-- | cmake/opentrack-platform.cmake | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/cmake/opentrack-platform.cmake b/cmake/opentrack-platform.cmake index 02c1b2f8..638260f1 100644 --- a/cmake/opentrack-platform.cmake +++ b/cmake/opentrack-platform.cmake @@ -34,12 +34,10 @@ set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING "" FORCE) include_directories("${CMAKE_SOURCE_DIR}") -set(opentrack_maintainer-mode FALSE CACHE INTERNAL "Select if developing core code (not modules)") - set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_DEFAULT 17) +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD_DEFAULT 20) set(CMAKE_CXX_STANDARD_REQUIRED TRUE) set(CMAKE_CXX_EXTENSIONS FALSE) @@ -54,7 +52,6 @@ set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) set(CMAKE_C_VISIBILITY_PRESET hidden) set(CMAKE_CXX_VISIBILITY_PRESET hidden) -set(CMAKE_MACOSX_RPATH OFF) if(NOT WIN32 AND NOT APPLE) include(opentrack-pkg-config) @@ -98,6 +95,7 @@ if(CMAKE_COMPILER_IS_GNUCXX AND NOT APPLE) add_link_options(-Wl,--exclude-libs,ALL) add_link_options(-Wl,-z,relro,-z,now) add_link_options(-Wl,--as-needed) + add_link_options(-Wl,-z,noexecstack) add_compile_options(-fno-plt) endif() endif() @@ -119,15 +117,15 @@ if(MSVC) add_definitions(-D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1) add_definitions(-D_SCL_SECURE_NO_WARNINGS) - add_compile_options(-EHs-c-) + #add_compile_options(-EHsc) add_definitions(-D_HAS_EXCEPTIONS=0) add_definitions(-D_ENABLE_EXTENDED_ALIGNED_STORAGE) add_definitions(-D_ENABLE_ATOMIC_ALIGNMENT_FIX) add_definitions(-D_SILENCE_CXX17_NEGATORS_DEPRECATION_WARNING) add_definitions(-D_SILENCE_CXX17_ADAPTOR_TYPEDEFS_DEPRECATION_WARNING) + add_definitions(-D_SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING) - add_compile_options(-diagnostics:caret) add_compile_options(-permissive-) if(opentrack-64bit) @@ -139,6 +137,16 @@ if(MSVC) add_link_options(-ignore:4020) add_link_options(-ignore:4217) # debug build + + if(MSVC_VERSION GREATER_EQUAL 1913) + if(NOT MSVC_VERSION GREATER_EQUAL 1929) + add_compile_options(-experimental:external) + endif() + add_compile_options(-external:W0 -external:anglebrackets) + endif() + add_compile_options(-Zc:preprocessor) + #add_compile_options(-Zc:inline) + #C4457: declaration of 'id' hides function parameter #C4456: declaration of 'i' hides previous local declaration #C4263 - member function does not override any base class virtual member function @@ -147,22 +155,15 @@ if(MSVC) #C4266 - no override available for virtual member function from base type, function is hidden #C4928 - illegal copy-initialization, more than one user-defined conversion has been implicitly applied #C4200: nonstandard extension used: zero-sized array in struct/union + #C4459: declaration of 'eps' hides global declaration - set(warns-disable 4530 4577 4789 4244 4702 4530 4244 4127 4458 4456 4251 4100 4702 4457 4200) + set(warns-disable 4530 4577 4789 4244 4702 4530 4244 4127 4458 4456 4251 4100 4702 4457 4200 4459) foreach(i ${warns-disable}) add_compile_options(-wd${i}) endforeach() endif() -if(APPLE) - add_compile_definitions(-stdlib=libc++) - add_link_options(-stdlib=libc++) - - add_link_options(-framework Cocoa -framework CoreFoundation -framework Carbon) - link_libraries(objc z) -endif() - if(NOT MSVC) include(FindPkgConfig) endif() |