mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-08 07:51:19 +12:00
build: minor refactoring and fixes
- Fix target_precompile_headers() usage; the CemuCommon target exposes the src/Common/precompiled.h precompiled header as part of its public interface with target_precompile_headers(CemuCommon PUBLIC precompiled.h), so all the other targets wanting to use the precompiled header have to link to the CemuCommon target with target_precompile_headers(TargetName PRIVATE CemuCommon). - Set the project version to 2.0 - Set RUNTIME_OUTPUT_DIRECTORY instead of only their _DEBUG and _RELEASE variants, fixing the compilation when neither build types are defined - Use a consistent indentation style (tabs, like in the .cpp files) - Use "modern" variants of some functions, e.g. add_definitions -> add_compile_definitions
This commit is contained in:
parent
b1e92f1779
commit
719ee90b27
13 changed files with 208 additions and 235 deletions
|
@ -1,43 +1,39 @@
|
|||
project(CemuAsm C)
|
||||
|
||||
IF (WIN32)
|
||||
if (WIN32)
|
||||
|
||||
enable_language(C ASM_MASM)
|
||||
enable_language(C ASM_MASM)
|
||||
|
||||
add_library(CemuAsm
|
||||
x64util_masm.asm
|
||||
)
|
||||
set_source_files_properties(x64util_masm.asm PROPERTIES LANGUAGE ASM_MASM)
|
||||
add_library(CemuAsm x64util_masm.asm)
|
||||
set_source_files_properties(x64util_masm.asm PROPERTIES LANGUAGE ASM_MASM)
|
||||
|
||||
# workaround for cr flag being passed to LINK.exe which considers it an input file and thus fails
|
||||
# doesn't always seem to happen. The Windows CI builds were fine, but locally I would run into this problem
|
||||
# possibly related to https://gitlab.kitware.com/cmake/cmake/-/issues/18889
|
||||
set(CMAKE_ASM_MASM_CREATE_STATIC_LIBRARY "<CMAKE_AR> /OUT:<TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
# workaround for cr flag being passed to LINK.exe which considers it an input file and thus fails
|
||||
# doesn't always seem to happen. The Windows CI builds were fine, but locally I would run into this problem
|
||||
# possibly related to https://gitlab.kitware.com/cmake/cmake/-/issues/18889
|
||||
set(CMAKE_ASM_MASM_CREATE_STATIC_LIBRARY "<CMAKE_AR> /OUT:<TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
|
||||
ELSE()
|
||||
else()
|
||||
|
||||
# NASM
|
||||
IF (APPLE)
|
||||
set(CMAKE_ASM_NASM_COMPILE_OBJECT "<CMAKE_ASM_NASM_COMPILER> -g -Fdwarf -f macho64 --prefix _ -o <OBJECT> <SOURCE>")
|
||||
ELSE()
|
||||
set(CMAKE_ASM_NASM_COMPILE_OBJECT "<CMAKE_ASM_NASM_COMPILER> -g -Fdwarf -f elf64 -o <OBJECT> <SOURCE>")
|
||||
ENDIF()
|
||||
set(CMAKE_ASM_NASM_LINK_EXECUTABLE "ld <FLAGS> <CMAKE_ASM_NASM_LINK_FLAGS> <LINK_FLAGS> -fPIC <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
|
||||
# NASM
|
||||
if (APPLE)
|
||||
set(CMAKE_ASM_NASM_COMPILE_OBJECT "<CMAKE_ASM_NASM_COMPILER> -g -Fdwarf -f macho64 --prefix _ -o <OBJECT> <SOURCE>")
|
||||
else()
|
||||
set(CMAKE_ASM_NASM_COMPILE_OBJECT "<CMAKE_ASM_NASM_COMPILER> -g -Fdwarf -f elf64 -o <OBJECT> <SOURCE>")
|
||||
endif()
|
||||
set(CMAKE_ASM_NASM_LINK_EXECUTABLE "ld <FLAGS> <CMAKE_ASM_NASM_LINK_FLAGS> <LINK_FLAGS> -fPIC <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
|
||||
|
||||
enable_language(C ASM_NASM)
|
||||
enable_language(C ASM_NASM)
|
||||
|
||||
add_library(CemuAsm
|
||||
x64util_nasm.asm
|
||||
)
|
||||
set_source_files_properties(x64util_nasm.asm PROPERTIES LANGUAGE ASM_NASM)
|
||||
add_library(CemuAsm x64util_nasm.asm)
|
||||
set_source_files_properties(x64util_nasm.asm PROPERTIES LANGUAGE ASM_NASM)
|
||||
|
||||
IF (APPLE)
|
||||
set_target_properties(CemuAsm PROPERTIES NASM_OBJ_FORMAT macho64)
|
||||
ELSE()
|
||||
set_target_properties(CemuAsm PROPERTIES NASM_OBJ_FORMAT elf64)
|
||||
ENDIF()
|
||||
set_target_properties(CemuAsm PROPERTIES LINKER_LANGUAGE C)
|
||||
if (APPLE)
|
||||
set_target_properties(CemuAsm PROPERTIES NASM_OBJ_FORMAT macho64)
|
||||
else()
|
||||
set_target_properties(CemuAsm PROPERTIES NASM_OBJ_FORMAT elf64)
|
||||
endif()
|
||||
set_target_properties(CemuAsm PROPERTIES LINKER_LANGUAGE C)
|
||||
|
||||
ENDIF()
|
||||
endif()
|
||||
|
||||
set_property(TARGET CemuAsm PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue