Skip to content

Commit

Permalink
Enable CI for windows
Browse files Browse the repository at this point in the history
Signed-off-by: Jiaxun Yang <[email protected]>
  • Loading branch information
FlyGoat committed Jun 5, 2019
1 parent f935377 commit fe140fd
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
ryzenadj
build/

# User-specific files
*.rsuser
Expand Down
34 changes: 24 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
language: cpp

compiler:
- gcc
- clang
matrix:
include:
- name: "Linux Build"
os: linux
dist: xenial
addons:
apt:
packages:
- cmake
- libpci3
- libpci-dev
before_script:
- mkdir build && cd build
- cmake ..
script:
- make

before_script:
- sudo apt-get install libpci3 libpci-dev
- mkdir build
- cd build
- cmake ..

script: make
- name: "Clang Windows Build"
os: windows
env:
- MATRIX_EVAL="CC=clang-cl && CXX=clang-cl"
before_install:
- eval "${MATRIX_EVAL}"
script:
- cmd.exe /C '.\travis-win.bat'
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ AUX_SOURCE_DIRECTORY(./ SRC_DIR)
if(WIN32)
ADD_EXECUTABLE(${PROJECT_NAME} lib/winring0.cpp lib/nb_smu_ops.c lib/api.c argparse.c main.c)
target_link_libraries(${PROJECT_NAME} WinRing0x64)
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE C)
ADD_LIBRARY (libryzenadj SHARED lib/winring0.cpp lib/nb_smu_ops.c lib/api.c)
target_link_libraries(libryzenadj WinRing0x64)
SET_TARGET_PROPERTIES(libryzenadj PROPERTIES LINKER_LANGUAGE C)
else()
ADD_EXECUTABLE(${PROJECT_NAME} lib/libpci.c lib/nb_smu_ops.c lib/api.c argparse.c main.c)
Expand Down
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ Debian-based distros this is covered by installing **pcilib-dev** package:

The simplest way to build it:

cmake CMakeLists.txt
mkdir build && cd build
cmake ..
make

### Windows
Expand All @@ -86,10 +87,3 @@ be used to compile for some reason.

Required dll is included in ./prebuilt of source tree. Please put the dll
library and sys driver in the same folder with ryzenadj.exe.

## TODO
- Determine the unit of time
- Add more options
- Code cleanup (The original program was written in C but now it's C++ in
order to call VC++ library)

6 changes: 6 additions & 0 deletions travis-win.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
echo off
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\Tools\VsDevCmd.bat" -host_arch=amd64 -arch=amd64
mkdir build
cd build
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release ..
nmake

0 comments on commit fe140fd

Please sign in to comment.