Skip to content

Commit 547bf5e

Browse files
committed
Merge pull request #251 from Atari2/different-output-folders
Fix #248 by giving executable and library different output folders
1 parent 7e1d78a commit 547bf5e

File tree

6 files changed

+40
-22
lines changed

6 files changed

+40
-22
lines changed

.github/workflows/cmake.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,22 @@ jobs:
4040
# Windows MSVC tests
4141
- name: App Test
4242
# Run app test
43-
run: ${{github.workspace}}/build/asar-tests/${{env.BUILD_TYPE}}/asar-app-test.exe ${{github.workspace}}/build/asar/${{env.BUILD_TYPE}}/asar.exe "${{github.workspace}}/tests" "${{github.workspace}}/dummy_rom.sfc" ${{github.workspace}}/build/temp
43+
run: ${{github.workspace}}/build/asar-tests/${{env.BUILD_TYPE}}/asar-app-test.exe ${{github.workspace}}/build/asar/bin/${{env.BUILD_TYPE}}/asar.exe "${{github.workspace}}/tests" "${{github.workspace}}/dummy_rom.sfc" ${{github.workspace}}/build/temp
4444
if: ${{ contains(matrix.config, 'msvc') }}
4545

4646
- name: DLL Test
4747
# Run app test
48-
run: ${{github.workspace}}/build/asar-tests/${{env.BUILD_TYPE}}/asar-dll-test.exe ${{github.workspace}}/build/asar/${{env.BUILD_TYPE}}/asar.dll "${{github.workspace}}/tests" "${{github.workspace}}/dummy_rom.sfc" ${{github.workspace}}/build/temp
48+
run: ${{github.workspace}}/build/asar-tests/${{env.BUILD_TYPE}}/asar-dll-test.exe ${{github.workspace}}/build/asar/lib/${{env.BUILD_TYPE}}/asar.dll "${{github.workspace}}/tests" "${{github.workspace}}/dummy_rom.sfc" ${{github.workspace}}/build/temp
4949
if: ${{ contains(matrix.config, 'msvc') }}
5050

5151
# Tests for other platforms
5252
- name: App Test
5353
# Run app test
54-
run: ${{github.workspace}}/build/asar-tests/asar-app-test ${{github.workspace}}/build/asar/asar "${{github.workspace}}/tests" "${{github.workspace}}/dummy_rom.sfc" ${{github.workspace}}/build/temp
54+
run: ${{github.workspace}}/build/asar-tests/asar-app-test ${{github.workspace}}/build/asar/bin/asar "${{github.workspace}}/tests" "${{github.workspace}}/dummy_rom.sfc" ${{github.workspace}}/build/temp
5555
if: ${{ !contains(matrix.config, 'msvc') }}
5656

5757
- name: DLL Test
5858
# Run app test
59-
run: ${{github.workspace}}/build/asar-tests/asar-dll-test ${{github.workspace}}/build/asar/libasar.so "${{github.workspace}}/tests" "${{github.workspace}}/dummy_rom.sfc" ${{github.workspace}}/build/temp
59+
run: ${{github.workspace}}/build/asar-tests/asar-dll-test ${{github.workspace}}/build/asar/lib/libasar.so "${{github.workspace}}/tests" "${{github.workspace}}/dummy_rom.sfc" ${{github.workspace}}/build/temp
6060
if: ${{ !contains(matrix.config, 'msvc') }}
6161

appveyor.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,17 @@ build:
4747
verbosity: minimal
4848

4949
artifacts:
50-
- path: build\asar\**\asar.exe
51-
- path: build\asar\**\*asar.dll
50+
- path: build\asar\bin\**\asar.exe
51+
- path: build\asar\lib\**\*asar.dll
5252

5353
configuration: MinSizeRel
5454

5555
test_script:
5656
# We need to pass the DLL path as an absolute path because it is used to calculate the std defines location, which will throw a warning when it's a relative path
5757
- cmd: >-
58-
asar-tests\%CONFIGURATION%\asar-dll-test.exe %APPVEYOR_BUILD_FOLDER%\build\asar\%CONFIGURATION%\asar.dll %APPVEYOR_BUILD_FOLDER%\tests ..\dummy_rom.sfc %APPVEYOR_BUILD_FOLDER%\tests_tmp_dll
58+
asar-tests\%CONFIGURATION%\asar-dll-test.exe %APPVEYOR_BUILD_FOLDER%\build\asar\lib\%CONFIGURATION%\asar.dll %APPVEYOR_BUILD_FOLDER%\tests ..\dummy_rom.sfc %APPVEYOR_BUILD_FOLDER%\tests_tmp_dll
5959
60-
asar-tests\%CONFIGURATION%\asar-app-test.exe asar\%CONFIGURATION%\asar.exe %APPVEYOR_BUILD_FOLDER%\tests ..\dummy_rom.sfc %APPVEYOR_BUILD_FOLDER%\tests_tmp_app
60+
asar-tests\%CONFIGURATION%\asar-app-test.exe asar\bin\%CONFIGURATION%\asar.exe %APPVEYOR_BUILD_FOLDER%\tests ..\dummy_rom.sfc %APPVEYOR_BUILD_FOLDER%\tests_tmp_app
6161
6262
deploy:
6363
provider: FTP
@@ -84,6 +84,6 @@ for:
8484

8585
test_script:
8686
- cmd: >-
87-
asar-tests\asar-dll-test.exe %APPVEYOR_BUILD_FOLDER%\build\asar\libasar.dll %APPVEYOR_BUILD_FOLDER%\tests ..\dummy_rom.sfc %APPVEYOR_BUILD_FOLDER%\tests_tmp_dll
87+
asar-tests\asar-dll-test.exe %APPVEYOR_BUILD_FOLDER%\build\asar\lib\libasar.dll %APPVEYOR_BUILD_FOLDER%\tests ..\dummy_rom.sfc %APPVEYOR_BUILD_FOLDER%\tests_tmp_dll
8888
89-
asar-tests\asar-app-test.exe asar\asar.exe %APPVEYOR_BUILD_FOLDER%\tests ..\dummy_rom.sfc %APPVEYOR_BUILD_FOLDER%\tests_tmp_app
89+
asar-tests\asar-app-test.exe asar\bin\asar.exe %APPVEYOR_BUILD_FOLDER%\tests ..\dummy_rom.sfc %APPVEYOR_BUILD_FOLDER%\tests_tmp_app

generate_release_zip.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99

1010
zipf = zipfile.ZipFile("asar"+sys.argv[1]+".zip", 'x', compression=zipfile.ZIP_DEFLATED)
1111

12-
build_server_prefix = "https://random.muncher.se/ftp/asar/windows/xp_compat/build/asar/MinSizeRel/"
13-
with urllib.request.urlopen(build_server_prefix + "asar.exe") as resp:
12+
build_server_prefix = lambda f, n: f"https://random.muncher.se/ftp/asar/windows/xp_compat/build/asar/{f}/MinSizeRel/{n}"
13+
with urllib.request.urlopen(build_server_prefix("bin", "asar.exe")) as resp:
1414
exe_data = resp.read()
15-
with urllib.request.urlopen(build_server_prefix + "asar.dll") as resp:
15+
with urllib.request.urlopen(build_server_prefix("lib", "asar.dll")) as resp:
1616
dll_data = resp.read()
1717

1818
zipf.writestr("asar.exe", exe_data)

run_tests.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ set ABS=%~dp0
22
set ABS=%ABS:~0,-1%
33
set CONFIG=Release
44
mkdir tests_tmp_dll tests_tmp_app
5-
%ABS%\asar-tests\%CONFIG%\asar-dll-test.exe %ABS%\asar\%CONFIG%\asar.dll %ABS%\tests %ABS%\dummy_rom.sfc %ABS%\tests_tmp_dll
6-
%ABS%\asar-tests\%CONFIG%\asar-app-test.exe %ABS%\asar\%CONFIG%\asar.exe %ABS%\tests %ABS%\dummy_rom.sfc %ABS%\tests_tmp_app
5+
%ABS%\asar-tests\%CONFIG%\asar-dll-test.exe %ABS%\asar\lib\%CONFIG%\asar.dll %ABS%\tests %ABS%\dummy_rom.sfc %ABS%\tests_tmp_dll
6+
%ABS%\asar-tests\%CONFIG%\asar-app-test.exe %ABS%\asar\bin\%CONFIG%\asar.exe %ABS%\tests %ABS%\dummy_rom.sfc %ABS%\tests_tmp_app
77
@pause

run_tests.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
ABS=$(pwd)
22
mkdir tests_tmp_dll tests_tmp_app
3-
$ABS/asar-tests/asar-dll-test $ABS/asar/libasar.so $ABS/tests $ABS/dummy_rom.sfc $ABS/tests_tmp_dll
4-
$ABS/asar-tests/asar-app-test $ABS/asar/asar $ABS/tests $ABS/dummy_rom.sfc $ABS/tests_tmp_app
3+
$ABS/asar-tests/asar-dll-test $ABS/asar/lib/libasar.so $ABS/tests $ABS/dummy_rom.sfc $ABS/tests_tmp_dll
4+
$ABS/asar-tests/asar-app-test $ABS/asar/bin/asar $ABS/tests $ABS/dummy_rom.sfc $ABS/tests_tmp_app

src/asar/CMakeLists.txt

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,11 +235,17 @@ if(ASAR_GEN_EXE)
235235
target_compile_options(asar-standalone PRIVATE -fprofile-arcs -ftest-coverage)
236236
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lgcov --coverage -fprofile-arcs")
237237
endif()
238-
239-
set_target_properties(asar-standalone PROPERTIES OUTPUT_NAME "asar")
240-
set_target_properties(asar-standalone PROPERTIES PDB_NAME "asar.exe")
238+
239+
set_target_properties(asar-standalone
240+
PROPERTIES
241+
OUTPUT_NAME "asar"
242+
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin"
243+
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin"
244+
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin"
245+
)
241246

242247
install(TARGETS asar-standalone)
248+
243249
endif(ASAR_GEN_EXE)
244250

245251

@@ -261,9 +267,15 @@ if(ASAR_GEN_DLL)
261267
target_compile_definitions(asar PRIVATE "ASAR_SHARED")
262268
set_asar_shared_properties(asar "T" TRUE)
263269

264-
set_target_properties(asar PROPERTIES PDB_NAME "asar.dll")
270+
set_target_properties(asar
271+
PROPERTIES
272+
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lib"
273+
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lib"
274+
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lib"
275+
)
265276

266277
install(TARGETS asar)
278+
267279
endif(ASAR_GEN_DLL)
268280

269281

@@ -283,7 +295,13 @@ if (ASAR_GEN_LIB)
283295
target_compile_definitions(asar-static PRIVATE "ASAR_STATIC")
284296
set_asar_shared_properties(asar-static "D" FALSE)
285297

298+
set_target_properties(asar-static
299+
PROPERTIES
300+
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lib"
301+
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lib"
302+
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lib"
303+
)
304+
286305
install(TARGETS asar-static)
287306

288-
# there's no need to set the PDB name since static libraries don't produce PDBs
289307
endif()

0 commit comments

Comments
 (0)