CMake: Add option to use precompiled headers
This commit is contained in:
parent
df72827b09
commit
a5b57bb9cd
2 changed files with 10 additions and 0 deletions
|
@ -16,6 +16,7 @@ option(DYNARMIC_IGNORE_ASSERTS "Ignore asserts" OFF)
|
||||||
option(DYNARMIC_TESTS "Build tests" ${MASTER_PROJECT})
|
option(DYNARMIC_TESTS "Build tests" ${MASTER_PROJECT})
|
||||||
option(DYNARMIC_TESTS_USE_UNICORN "Enable fuzzing tests against unicorn" OFF)
|
option(DYNARMIC_TESTS_USE_UNICORN "Enable fuzzing tests against unicorn" OFF)
|
||||||
option(DYNARMIC_USE_LLVM "Support disassembly of jitted x86_64 code using LLVM" OFF)
|
option(DYNARMIC_USE_LLVM "Support disassembly of jitted x86_64 code using LLVM" OFF)
|
||||||
|
option(DYNARMIC_USE_PRECOMPILED_HEADERS "Use precompiled headers" ON)
|
||||||
option(DYNARMIC_WARNINGS_AS_ERRORS "Warnings as errors" ${MASTER_PROJECT})
|
option(DYNARMIC_WARNINGS_AS_ERRORS "Warnings as errors" ${MASTER_PROJECT})
|
||||||
if (NOT DEFINED DYNARMIC_FRONTENDS)
|
if (NOT DEFINED DYNARMIC_FRONTENDS)
|
||||||
set(DYNARMIC_FRONTENDS "A32;A64" CACHE STRING "Selects which frontends to enable")
|
set(DYNARMIC_FRONTENDS "A32;A64" CACHE STRING "Selects which frontends to enable")
|
||||||
|
|
|
@ -454,3 +454,12 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||||
target_compile_definitions(dynarmic PRIVATE FMT_USE_WINDOWS_H=0)
|
target_compile_definitions(dynarmic PRIVATE FMT_USE_WINDOWS_H=0)
|
||||||
endif()
|
endif()
|
||||||
target_compile_definitions(dynarmic PRIVATE FMT_USE_USER_DEFINED_LITERALS=1)
|
target_compile_definitions(dynarmic PRIVATE FMT_USE_USER_DEFINED_LITERALS=1)
|
||||||
|
|
||||||
|
if (DYNARMIC_USE_PRECOMPILED_HEADERS)
|
||||||
|
set(PRECOMPILED_HEADERS "$<$<COMPILE_LANGUAGE:CXX>:${CMAKE_CURRENT_SOURCE_DIR}/ir/ir_emitter.h>")
|
||||||
|
if (ARCHITECTURE STREQUAL "x86_64")
|
||||||
|
list(PREPEND PRECOMPILED_HEADERS "$<$<COMPILE_LANGUAGE:CXX>:<xbyak/xbyak.h$<ANGLE-R>>")
|
||||||
|
endif()
|
||||||
|
target_precompile_headers(dynarmic PRIVATE ${PRECOMPILED_HEADERS})
|
||||||
|
set(CMAKE_PCH_INSTANTIATE_TEMPLATES ON)
|
||||||
|
endif()
|
||||||
|
|
Loading…
Reference in a new issue