Skip to content

Commit

Permalink
Adjust windows cmake flags
Browse files Browse the repository at this point in the history
  • Loading branch information
em-eight committed Sep 24, 2023
1 parent f2159e7 commit 94fdac9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 19 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,15 @@ jobs:
- name: CMake generate
env:
ARTIFACT_NAME: ppc2cpp-${{ runner.os }}
WINDOWS_FLAGS: -S . -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_GENERATOR_PLATFORM=x64
run: |
echo $WINDOWS_FLAGS
cmake --version
cmake -B build \
-DCMAKE_INSTALL_PREFIX=$ARTIFACT_NAME \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTING=OFF \
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang
$WINDOWS_FLAGS
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
-S . -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_GENERATOR_PLATFORM=x64
shell: bash
- name: Build
run: cmake --build build --target install -j
Expand Down
17 changes: 1 addition & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ project(ppc2cpp VERSION 1.0)

set(CMAKE_CXX_STANDARD 20)

# Dependency sadness ###########################################################

# CPM fetches and builds external dependencies
include(cmake/CPM.cmake)

Expand All @@ -14,7 +12,6 @@ CPMAddPackage("gh:em-eight/ninutils#81b4910")
# ELF binary parser
CPMAddPackage("gh:serge1/ELFIO#8ae6cec")
# disassebler
#CPMAddPackage("gh:em-eight/ppcdisasm-cpp#4e2c2e1")
CPMAddPackage(
NAME ppcdisasm-cpp
OPTIONS "BUILD_TESTING OFF"
Expand All @@ -35,17 +32,6 @@ CPMAddPackage(
# {fmt}
CPMAddPackage("gh:fmtlib/fmt#10.0.0")

# Import Protobuf
#
# There is a lot of pain behind this.
# The Protobuf repo itself and CMake provide their own ways
# to locate the library in CMake. We are using FindProtobuf.cmake
# which is part of CMake since version 3.9.

# If the Protobuf_LIBRARY workaround is used (see README), the user
# could either specify a static or shared library. Depending on either,
# we need to correctly set the link mode before calling find_package.
# Newer versions of Protobuf depend on Abseil.
set(Protobuf_USE_STATIC_LIBS ON)

find_package(protobuf CONFIG)
Expand All @@ -55,10 +41,8 @@ if(NOT protobuf_FOUND) # Legacy protobuf support
include(FindProtobuf)
find_package(Protobuf REQUIRED)
endif()
include_directories(${Protobuf_INCLUDE_DIRS})

# Generate Protobuf files
# This is provided by FindProtobuf.cmake
set(PROTO_DIR "${CMAKE_CURRENT_SOURCE_DIR}/proto")
file(GLOB PROTO_FILES "${PROTO_DIR}/*.proto")
if(protobuf_MODULE_COMPATIBLE)
Expand All @@ -77,6 +61,7 @@ if(protobuf_MODULE_COMPATIBLE)
${YAML_CPP_SOURCE_DIR}/include
# protobuf_generate_cpp drops .pb.{h.c} files here.
${CMAKE_CURRENT_BINARY_DIR}
${PROTOBUF_INCLUDE_DIRS}
)
target_link_libraries(ppc2cpp_core PUBLIC dolrel ppcdisasm elfio fmt ${Protobuf_LIBRARIES} yaml-cpp)
else()
Expand Down

0 comments on commit 94fdac9

Please sign in to comment.