mirror of
https://github.com/asmjit/asmjit.git
synced 2025-12-17 04:24:37 +03:00
Minor changes to cmake files
This commit is contained in:
@@ -42,7 +42,9 @@ set(ASMJIT_BUILD_TEST ${ASMJIT_BUILD_TEST} CACHE BOOLEAN "Build 'asmjit_t
|
|||||||
# =============================================================================
|
# =============================================================================
|
||||||
|
|
||||||
include("${ASMJIT_DIR}/CxxProject.cmake")
|
include("${ASMJIT_DIR}/CxxProject.cmake")
|
||||||
|
|
||||||
cxx_project(asmjit)
|
cxx_project(asmjit)
|
||||||
|
cxx_detect_standard(ASMJIT_PRIVATE_CFLAGS)
|
||||||
|
|
||||||
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
||||||
set(ASMJIT_PRIVATE_LFLAGS "/OPT:REF /OPT:ICF")
|
set(ASMJIT_PRIVATE_LFLAGS "/OPT:REF /OPT:ICF")
|
||||||
@@ -58,7 +60,6 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "^(GNU|Clang)$")
|
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "^(GNU|Clang)$")
|
||||||
cxx_detect_standard(ASMJIT_PRIVATE_CFLAGS)
|
|
||||||
cxx_detect_cflags(ASMJIT_PRIVATE_CFLAGS
|
cxx_detect_cflags(ASMJIT_PRIVATE_CFLAGS
|
||||||
"-fno-tree-vectorize"
|
"-fno-tree-vectorize"
|
||||||
"-fvisibility=hidden"
|
"-fvisibility=hidden"
|
||||||
@@ -69,10 +70,6 @@ if("${CMAKE_CXX_COMPILER_ID}" MATCHES "^(GNU|Clang)$")
|
|||||||
"-fmerge-all-constants")
|
"-fmerge-all-constants")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ASMJIT_TRACE)
|
|
||||||
list(APPEND ASMJIT_PRIVATE_CFLAGS "${CXX_DEFINE}ASMJIT_TRACE")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
list(APPEND ASMJIT_PRIVATE_CFLAGS "${CXX_DEFINE}_UNICODE")
|
list(APPEND ASMJIT_PRIVATE_CFLAGS "${CXX_DEFINE}_UNICODE")
|
||||||
else()
|
else()
|
||||||
|
|||||||
@@ -27,7 +27,12 @@ if (NOT __CXX_INCLUDED)
|
|||||||
|
|
||||||
function(cxx_detect_standard out)
|
function(cxx_detect_standard out)
|
||||||
set(out_array)
|
set(out_array)
|
||||||
cxx_detect_cflags(out_array "-std=c++14" "-std=c++11" "-std=c++0x")
|
|
||||||
|
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
||||||
|
cxx_detect_cflags(out_array "/std:c++latest" "/std:c++14")
|
||||||
|
else()
|
||||||
|
cxx_detect_cflags(out_array "-std=c++17" "-std=c++14" "-std=c++11" "-std=c++0x")
|
||||||
|
endif()
|
||||||
|
|
||||||
# Keep only the first flag detected, which keeps the highest version supported.
|
# Keep only the first flag detected, which keeps the highest version supported.
|
||||||
if(out_array)
|
if(out_array)
|
||||||
|
|||||||
Reference in New Issue
Block a user